fix(06): WR-04 use local-date helper in calendarStore instead of UTC toISOString slice
This commit is contained in:
@@ -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())}`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user