From 697bffdb8b1bef143823f77a118de90286fe325a Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 24 Sep 2023 14:47:30 -0700 Subject: [PATCH] fix: treat the 0 time as invalid too --- quartz/plugins/transformers/lastmod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/plugins/transformers/lastmod.ts b/quartz/plugins/transformers/lastmod.ts index 7deeefb..feca4b5 100644 --- a/quartz/plugins/transformers/lastmod.ts +++ b/quartz/plugins/transformers/lastmod.ts @@ -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(