refactor: event instances

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-07-03 19:10:00 -04:00
parent acbe0ad5ca
commit 37fa7b911e
17 changed files with 498 additions and 479 deletions
+15
View File
@@ -66,6 +66,21 @@ describe('occurrence index', () => {
expect(occurrencesForDay(index, new Date(2026, 5, 21))).toHaveLength(0)
})
it('treats UTC timestamps on timeless events as floating calendar dates', () => {
const allDay = eventEntity(
'utc-all-day',
'2025-03-27T00:00:00+00:00',
'2025-03-28T00:00:00+00:00',
true,
)
const index = buildOccurrenceIndex([allDay])
expect(occurrencesForDay(index, new Date(2025, 2, 26))).toHaveLength(0)
expect(occurrencesForDay(index, new Date(2025, 2, 27))).toHaveLength(1)
expect(occurrencesForDay(index, new Date(2025, 2, 28))).toHaveLength(0)
expect(new Date(index.sorted[0].startMs).getHours()).toBe(0)
})
it('retrieves overlapping occurrences without duplicates', () => {
const spanning = eventEntity(
'spanning',