fix(06): WR-04 use local-date helper in calendarStore instead of UTC toISOString slice

This commit is contained in:
Lucas Berger
2026-06-10 16:52:33 -04:00
parent ac0f8d282b
commit 746c3c70d7
2 changed files with 14 additions and 5 deletions
+6 -2
View File
@@ -68,8 +68,12 @@ function pad2(n: number): string {
return n < 10 ? `0${n}` : `${n}`
}
/** Format a Date as 'YYYY-MM-DD' using LOCAL calendar accessors. */
function localDateISO(d: Date): string {
/**
* Format a Date as 'YYYY-MM-DD' using LOCAL calendar accessors.
* WR-04: exported as the single source for local-date formatting so calendarStore
* (initialCalendarRange/todayIso) can drop its banned toISOString().slice(0,10).
*/
export function localDateISO(d: Date): string {
return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`
}