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