@eshal-bot/chat-widget 0.1.119 → 0.1.121
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/{chat-widget-MarkdownRenderer-DNwZHSKy.esm.js → chat-widget-MarkdownRenderer-CN8zkiaY.esm.js} +2 -2
- package/dist/{chat-widget-index-yu9GyyYn.esm.js → chat-widget-index-BYWKHNNo.esm.js} +1 -1
- package/dist/chat-widget-markdown-chunk.js +14 -4
- package/dist/chat-widget-markdown-chunk.min.js +1 -1
- package/dist/chat-widget.esm.js +1 -1
- package/dist/chat-widget.umd.js +1 -1
- package/package.json +1 -1
|
@@ -89365,12 +89365,22 @@
|
|
|
89365
89365
|
const _ISO_DATETIME_CELL_RE = /^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2})?(\.\d+)?(Z|[+-]\d{2}:?\d{2})?)?$/;
|
|
89366
89366
|
function _formatDateCell(value) {
|
|
89367
89367
|
if (typeof value !== 'string') return null;
|
|
89368
|
-
|
|
89369
|
-
|
|
89368
|
+
const trimmed = value.trim();
|
|
89369
|
+
if (!_ISO_DATETIME_CELL_RE.test(trimmed)) return null;
|
|
89370
|
+
// A date-time string with no trailing 'Z'/offset is parsed by `new
|
|
89371
|
+
// Date()` as LOCAL time (ECMA-262), but we read it back below via UTC
|
|
89372
|
+
// getters - so a timezone-less value must be normalized to UTC first,
|
|
89373
|
+
// or a non-UTC runtime renders the wrong calendar day/time (EV-2783
|
|
89374
|
+
// follow-up). Date-only strings (no time part) are already parsed as
|
|
89375
|
+
// UTC midnight per spec and need no change.
|
|
89376
|
+
const hasTime = /[T ]\d{2}:\d{2}/.test(trimmed);
|
|
89377
|
+
const hasTz = /(Z|[+-]\d{2}:?\d{2})$/.test(trimmed);
|
|
89378
|
+
const parseable = hasTime && !hasTz ? "".concat(trimmed.replace(' ', 'T'), "Z") : trimmed;
|
|
89379
|
+
const d = new Date(parseable);
|
|
89370
89380
|
if (isNaN(d.getTime())) return null;
|
|
89371
|
-
const
|
|
89381
|
+
const hasNonMidnightTime = hasTime && (d.getUTCHours() !== 0 || d.getUTCMinutes() !== 0 || d.getUTCSeconds() !== 0);
|
|
89372
89382
|
const dateStr = "".concat(_MONTH_NAMES[d.getUTCMonth()], " ").concat(d.getUTCDate(), ", ").concat(d.getUTCFullYear());
|
|
89373
|
-
if (!
|
|
89383
|
+
if (!hasNonMidnightTime) return dateStr;
|
|
89374
89384
|
const h = d.getUTCHours();
|
|
89375
89385
|
const ampm = h >= 12 ? 'PM' : 'AM';
|
|
89376
89386
|
const h12 = h % 12 || 12;
|