#1069 Handle string timestamps as numbers

This commit is contained in:
Cohee 2024-06-09 11:15:17 +03:00
parent 4e822eeebb
commit 67f2c380a3

View File

@ -640,7 +640,7 @@ function parseTimestamp(timestamp) {
}
// Unix time (legacy TAI / tags)
if (typeof timestamp === 'number') {
if (typeof timestamp === 'number' || /^\d+$/.test(timestamp)) {
if (isNaN(timestamp) || !isFinite(timestamp) || timestamp < 0) {
return moment.invalid();
}