fix: treat the 0 time as invalid too

This commit is contained in:
Jacky Zhao 2023-09-24 14:47:30 -07:00
parent ea5742c328
commit 697bffdb8b

View File

@ -14,7 +14,7 @@ const defaultOptions: Options = {
function coerceDate(fp: string, d: any): Date {
const dt = new Date(d)
const invalidDate = isNaN(dt.getTime())
const invalidDate = isNaN(dt.getTime()) || dt.getTime() === 0
if (invalidDate && d !== undefined) {
console.log(
chalk.yellow(