Files
calendula/app
Jean-Luc Makiola 7c94425e41
All checks were successful
Translations / check (pull_request) Successful in 6s
CI / ci (pull_request) Successful in 10m32s
fix(search): date all-day results in UTC, like every other view (#82)
Search formatted a result's date with ZoneId.systemDefault(), while the
month, week, day, agenda and detail surfaces all resolve an all-day event's
dates in UTC. All-day events are stored at UTC midnight with an exclusive
end, so west of UTC that difference is a whole day: an event on the 19th
came back from search dated the 18th, contradicting the grid it was filed
in. East of UTC the offset happens to land on the same date, which is why
this went unnoticed.

The rule was already written down twice — once as a private helper in
AgendaUiState, once inline in coversDay and formatWhen — so rather than
adding a third copy, dateZone/spanFirstDay/spanLastDay/spansMultipleDays
move into domain/Models.kt, where they are pure date logic rather than
agenda UI state, and search reads its date through spanFirstDay. The clock
time stays in the device zone; it is only ever rendered for timed events.

Covered by EventInstanceSpanTest, which pins both directions: the west-of-
UTC case from this issue and the east-of-UTC leak from #65.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 18:48:48 +02:00
..