acsi-core 1.2.18 → 1.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3500,43 +3500,25 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
3500
3500
  }, rest));
3501
3501
  };
3502
3502
 
3503
- var isDateOnlyFormat = function isDateOnlyFormat(fmt) {
3504
- return !/[Hhms]/.test(fmt);
3505
- };
3506
- var parseOffsetToMinutes = function parseOffsetToMinutes(cleanOffset) {
3507
- if (/^[+-]?\d+$/.test(cleanOffset)) {
3508
- return parseInt(cleanOffset, 10) * 60;
3509
- }
3510
- return moment().utcOffset(cleanOffset).utcOffset();
3511
- };
3512
3503
  var utcToLocalTime = (function (time, FORMAT) {
3513
3504
  if (time === DATE_MIN_VALUE || time == null) return "";
3514
3505
  var timezone = localStorage.getItem(TIMEZONE_ID) || "";
3515
- var fmt = FORMAT || "yyyy-MM-DD";
3516
3506
  try {
3517
3507
  if (!timezone) {
3518
- if (isDateOnlyFormat(fmt)) {
3519
- var localOffset = moment().utcOffset();
3520
- if (localOffset <= 0) return moment.utc(time).format(fmt);
3521
- }
3522
- return moment.utc(time).local().format(fmt);
3508
+ return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
3523
3509
  }
3524
3510
  var isOffset = /^(UTC|GMT)?[+-]/.test(timezone);
3525
3511
  if (isOffset) {
3526
3512
  var cleanOffset = timezone.replace(/UTC|GMT/gi, "").trim();
3527
- var offsetMinutes = parseOffsetToMinutes(cleanOffset);
3528
- if (isDateOnlyFormat(fmt) && offsetMinutes <= 0) {
3529
- return moment.utc(time).format(fmt);
3530
- }
3531
- return moment.utc(time).utcOffset(offsetMinutes).format(fmt);
3532
- }
3533
- if (isDateOnlyFormat(fmt)) {
3534
- var tzOffset = moment.utc(time).tz(timezone).utcOffset();
3535
- if (tzOffset <= 0) {
3536
- return moment.utc(time).format(fmt);
3513
+ var offsetMinutes;
3514
+ if (/^[+-]?\d+$/.test(cleanOffset)) {
3515
+ offsetMinutes = parseInt(cleanOffset, 10) * 60;
3516
+ } else {
3517
+ offsetMinutes = cleanOffset;
3537
3518
  }
3519
+ return moment.utc(time).utcOffset(offsetMinutes).format(FORMAT || "yyyy-MM-DD");
3538
3520
  }
3539
- return moment.utc(time).tz(timezone).format(fmt);
3521
+ return moment.utc(time).tz(timezone).format(FORMAT || "yyyy-MM-DD");
3540
3522
  } catch (_unused) {
3541
3523
  return "";
3542
3524
  }