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.
package/dist/index.js CHANGED
@@ -3498,43 +3498,25 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
3498
3498
  }, rest));
3499
3499
  };
3500
3500
 
3501
- var isDateOnlyFormat = function isDateOnlyFormat(fmt) {
3502
- return !/[Hhms]/.test(fmt);
3503
- };
3504
- var parseOffsetToMinutes = function parseOffsetToMinutes(cleanOffset) {
3505
- if (/^[+-]?\d+$/.test(cleanOffset)) {
3506
- return parseInt(cleanOffset, 10) * 60;
3507
- }
3508
- return moment().utcOffset(cleanOffset).utcOffset();
3509
- };
3510
3501
  var utcToLocalTime = (function (time, FORMAT) {
3511
3502
  if (time === DATE_MIN_VALUE || time == null) return "";
3512
3503
  var timezone = localStorage.getItem(TIMEZONE_ID) || "";
3513
- var fmt = FORMAT || "yyyy-MM-DD";
3514
3504
  try {
3515
3505
  if (!timezone) {
3516
- if (isDateOnlyFormat(fmt)) {
3517
- var localOffset = moment().utcOffset();
3518
- if (localOffset <= 0) return moment.utc(time).format(fmt);
3519
- }
3520
- return moment.utc(time).local().format(fmt);
3506
+ return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
3521
3507
  }
3522
3508
  var isOffset = /^(UTC|GMT)?[+-]/.test(timezone);
3523
3509
  if (isOffset) {
3524
3510
  var cleanOffset = timezone.replace(/UTC|GMT/gi, "").trim();
3525
- var offsetMinutes = parseOffsetToMinutes(cleanOffset);
3526
- if (isDateOnlyFormat(fmt) && offsetMinutes <= 0) {
3527
- return moment.utc(time).format(fmt);
3528
- }
3529
- return moment.utc(time).utcOffset(offsetMinutes).format(fmt);
3530
- }
3531
- if (isDateOnlyFormat(fmt)) {
3532
- var tzOffset = moment.utc(time).tz(timezone).utcOffset();
3533
- if (tzOffset <= 0) {
3534
- return moment.utc(time).format(fmt);
3511
+ var offsetMinutes;
3512
+ if (/^[+-]?\d+$/.test(cleanOffset)) {
3513
+ offsetMinutes = parseInt(cleanOffset, 10) * 60;
3514
+ } else {
3515
+ offsetMinutes = cleanOffset;
3535
3516
  }
3517
+ return moment.utc(time).utcOffset(offsetMinutes).format(FORMAT || "yyyy-MM-DD");
3536
3518
  }
3537
- return moment.utc(time).tz(timezone).format(fmt);
3519
+ return moment.utc(time).tz(timezone).format(FORMAT || "yyyy-MM-DD");
3538
3520
  } catch (_unused) {
3539
3521
  return "";
3540
3522
  }