From 0c39e8d16f2a57ba50a6883ed6dc13fc6c9f0467 Mon Sep 17 00:00:00 2001 From: xin Date: Wed, 15 Apr 2026 19:55:50 +0800 Subject: [PATCH] fix(usage): handle Date inputs in timestamp parser --- src/utils/timestamp.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/timestamp.ts b/src/utils/timestamp.ts index 19eff5a..04c5615 100644 --- a/src/utils/timestamp.ts +++ b/src/utils/timestamp.ts @@ -24,6 +24,9 @@ export function parseTimestampMs(value: unknown): number { if (typeof value === 'number' && Number.isFinite(value)) { return value; } + if (value instanceof Date) { + return value.getTime(); + } if (typeof value !== 'string') { return Number.NaN; }