Skip to content

Commit a722a45

Browse files
committed
ESLint warnings on .success
1 parent 7f8e930 commit a722a45

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/data-loader.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ export function formatDate(dateStr: string, timezone?: string, locale?: string):
569569
export function formatDateCompact(dateStr: string, timezone: string | undefined, locale: string): string {
570570
// For YYYY-MM-DD format, append T00:00:00 to parse as local date
571571
// Without this, new Date('YYYY-MM-DD') interprets as UTC midnight
572-
const date = dailyDateSchema.safeParse(dateStr).success
572+
const parseResult = dailyDateSchema.safeParse(dateStr);
573+
const date = parseResult.success
573574
? timezone != null
574575
? new Date(`${dateStr}T00:00:00Z`)
575576
: new Date(`${dateStr}T00:00:00`)

0 commit comments

Comments
 (0)