dayjs icon indicating copy to clipboard operation
dayjs copied to clipboard

Fixed Incorrect parsing of timestamp passing as string

Open Khyati-Kapil opened this issue 3 months ago • 0 comments

fix(parse): correctly parse numeric string timestamps as timestamps

Previously, dayjs("1762232987879") would attempt to parse the string as a date format, resulting in an incorrect negative timestam and wrong date formatting. This occurred because the regex for date parsing matched the string before checking if it was a numeric timestamp.

Now, numeric string timestamps are checked and parsed as timestamps before attempting date string parsing.

This fix resolves issues with isBefore, isAfter, and formatting methods when using numeric string inputs.

Khyati-Kapil avatar Nov 11 '25 19:11 Khyati-Kapil