events: timezone + DST support + 17 tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m5s

timezone.sx: wall-clock LOCAL <-> absolute UTC. :fixed + :dst zones (std/dst
offsets + UTC transition rules, EU-style, no IANA DB) computed via calendar
helpers. ev-event-tz authors in local time; ev-expand expands tz events in
LOCAL time then converts each occurrence to UTC, so a 09:00 weekly meeting
stays 09:00 across a DST change (UTC instant shifts). Predefined utc/london/
paris. Plain events unaffected. 295/295 green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-07 09:31:11 +00:00
parent c991c7c3d3
commit bf7bd38010
7 changed files with 339 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ capacity rules, transactional booking, and a flow-driven notification dispatcher
## Status (rolling)
`bash lib/events/conformance.sh`**278/278** (Phases 1-4 + 7 ext: fed f/b, waitlist, EXDATE/RDATE, overrides, booking/reschedule-notify, fed transport)
`bash lib/events/conformance.sh`**295/295** (Phases 1-4 + 8 ext: fed f/b, waitlist, EXDATE/RDATE, overrides, booking/reschedule-notify, fed transport, timezones+DST)
## Ground rules
@@ -86,6 +86,16 @@ lib/events/api.sx ── (events/schedule) (events/book) (events/agenda) ──
## Progress log
- 2026-06-07 — Timezone + DST support (user request). `timezone.sx`: a tz maps
wall-clock LOCAL ↔ absolute UTC (offset = local-utc). :fixed (constant) and
:dst (std/dst offsets + two UTC transition rules, e.g. EU last-Sun-Mar/Oct
01:00 UTC) zones, no IANA DB — transitions computed via calendar helpers
(ev-resolve-nth-weekday). `ev-event-tz` authors an event in local time + a tz;
`ev-expand` dispatches: tz events expand in LOCAL time (recurrence + EXDATE/
RDATE + overrides all wall-clock), then each occurrence converts to UTC, so a
"09:00 weekly" meeting stays 09:00 across a DST change (its UTC instant
shifts). Predefined ev-tz-utc/london/paris. local->utc inverts with a one-step
refinement. Plain events unaffected (ev-expand-naive). +17 tests, 295/295 green.
- 2026-06-07 — Injected federation transport (last plan item). `fetch` abstracts
how a peer's agenda arrives: (fetch peer-id ws we) -> {:status :ok :occurrences}
| {:status :error}. `ev/federated-agenda-via` merges local + each trusted