acsi-core 1.1.1 → 1.1.3

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.
@@ -3472,19 +3472,30 @@ var utcToLocalTime = (function (time, FORMAT) {
3472
3472
  });
3473
3473
 
3474
3474
  var timeSpanToLocalMoment = (function (time, timezone) {
3475
- if (timezone === void 0) {
3476
- timezone = "UTC";
3477
- }
3478
3475
  if (!time) return null;
3479
3476
  if (time.split(":").length !== 3) return null;
3477
+ if (!timezone) {
3478
+ var totalSeconds = +time.split(":")[0] * 60 * 60 + +time.split(":")[1] * 60 + +time.split(":")[2];
3479
+ var startOfDay = moment$1.utc().startOf("day");
3480
+ var _dateTime = startOfDay.add(totalSeconds, "seconds");
3481
+ return _dateTime.local();
3482
+ }
3480
3483
  var dateTime;
3481
3484
  var isOffset = /^(UTC|GMT)?[+-]/.test(timezone);
3485
+ console.log({
3486
+ isOffset: isOffset
3487
+ });
3482
3488
  if (isOffset) {
3483
- dateTime = moment$1.utc(time, "HH:mm:ss").utcOffset(timezone);
3489
+ var cleanOffset = timezone.replace(/UTC|GMT/gi, '').trim();
3490
+ console.log({
3491
+ cleanOffset: cleanOffset
3492
+ });
3493
+ dateTime = moment$1.utc(time, "HH:mm:ss").utcOffset(cleanOffset, true);
3484
3494
  } else {
3485
3495
  dateTime = moment$1.tz(time, "HH:mm:ss", timezone);
3486
3496
  }
3487
- return dateTime.local();
3497
+ console.log("run time", dateTime.format("HH:mm:ss"), timezone);
3498
+ return dateTime;
3488
3499
  });
3489
3500
 
3490
3501
  var historyCore = createBrowserHistory();