@mcpcn/mcp-notification 1.1.6 → 1.1.7
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 +16 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -311,12 +311,23 @@ class ReminderServer {
|
|
|
311
311
|
const mm = String(abs % 60).padStart(2, '0');
|
|
312
312
|
return `${sign}${hh}:${mm}`;
|
|
313
313
|
};
|
|
314
|
-
const toLocal = (
|
|
315
|
-
if (
|
|
316
|
-
return
|
|
317
|
-
|
|
314
|
+
const toLocal = (v) => {
|
|
315
|
+
if (v === undefined || v === null)
|
|
316
|
+
return v;
|
|
317
|
+
let ms;
|
|
318
|
+
if (typeof v === 'number') {
|
|
319
|
+
ms = v > 1e12 ? v : v * 1000;
|
|
320
|
+
}
|
|
321
|
+
else if (typeof v === 'string') {
|
|
322
|
+
const s = v.trim();
|
|
323
|
+
if (/^\d{10}$/.test(s))
|
|
324
|
+
ms = parseInt(s, 10) * 1000;
|
|
325
|
+
else if (/^\d{13}$/.test(s))
|
|
326
|
+
ms = parseInt(s, 10);
|
|
327
|
+
}
|
|
328
|
+
const d = ms !== undefined ? new Date(ms) : new Date(v);
|
|
318
329
|
if (isNaN(d.getTime()))
|
|
319
|
-
return
|
|
330
|
+
return v;
|
|
320
331
|
const y = d.getFullYear();
|
|
321
332
|
const m = String(d.getMonth() + 1).padStart(2, '0');
|
|
322
333
|
const day = String(d.getDate()).padStart(2, '0');
|