fix(02): window occurrences in UTC, not server-local timezone
ICAL.Time.fromJSDate(window, false) interpreted the UTC-midnight window bounds in the server's local TZ (America/New_York in dev), shifting the window by the server offset and dropping evening occurrences near a day window's end (e.g. June 11 17:45-04:00 = 21:45Z was excluded from the June-11 day view). Use UTC so the window is deterministic and correct.
This commit is contained in:
@@ -209,8 +209,13 @@ export function expandOccurrences(
|
||||
const allDay: boolean = dtstart.isDate
|
||||
const uid: string = event.uid ?? ''
|
||||
|
||||
const rangeStart = ICAL.Time.fromJSDate(windowStart, false)
|
||||
const rangeEnd = ICAL.Time.fromJSDate(windowEnd, false)
|
||||
// useUTC=true: windowStart/windowEnd are absolute instants (midnight-UTC of the
|
||||
// requested dates). Interpreting them in UTC keeps the occurrence-window comparison
|
||||
// absolute. With useUTC=false ical.js used the SERVER's local timezone, shifting the
|
||||
// window by the server's offset and dropping evening occurrences near the window end
|
||||
// (e.g. a 17:45-04:00 event = 21:45Z fell past a day window whose end was shifted to 20:00).
|
||||
const rangeStart = ICAL.Time.fromJSDate(windowStart, true)
|
||||
const rangeEnd = ICAL.Time.fromJSDate(windowEnd, true)
|
||||
|
||||
const occurrences: CalendarOccurrence[] = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user