Skip to content

Event time fixes - #1393

Open
stain wants to merge 6 commits into
ElixirTeSS:masterfrom
stain:event-time-fixes
Open

stain wants to merge 6 commits into
ElixirTeSS:masterfrom
stain:event-time-fixes

Conversation

@stain

@stain stain commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary of changes

Bug fixes for event times, with no new dependencies or migrations:

  • Bioschemas and JSON-API times in ISO 8601 with the event's UTC offset on that date
    (2026-10-22T09:00:00-03:00), or without an offset when the time zone is unknown, instead of the stored local
    time labelled as UTC (2026-10-22 09:00:00 UTC, …T09:00:00.000Z). The legacy JSON API is unchanged (see below).
  • iCalendar, Indico and Gray Scott ingestors store local time, like the form and the other ingestors. They
    stored DTSTART;TZID=… converted to UTC, so e.g. a 09:45 event in Perth showed as 01:45, and was exported to
    iCal/Google Calendar 8 hours early. Upcoming events are corrected when their source is next ingested.
  • Exports of events without a time zone use floating local times (DTSTART:20261105T090000), so calendars
    show them on the right day, rather than as UTC (a 09:00–17:00 event in Australia ended at 04:00 the next day).
    The Google Calendar link gives the IANA zone (ctz=Australia/Perth, was Perth).
  • No dependency on the server's time zone: new event defaults (DateTime.now) and the event calendar
    (Date.today).
  • docs/timezones.md: how event times and time zones are stored, and what ingestors need to do.

Motivation and context

Fixes most of #1391. TeSS stores start/end as local (wall clock) time with the zone in timezone, but several
outputs and ingestors treated the stored value as UTC.

Question

The legacy JSON API (events.json) still gives the stored local time as UTC (…T09:00:00.000Z). Should it get the
same fix? It is ready, without new keys, as one commit on
event-time-fixes-legacy-json.

Tests

Updated and new tests for the outputs, ingestors (checking start_utc rather than the stored column), exports and
server time zones. Full suite passes.

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

🤖 Generated with Claude Code

stain and others added 6 commits October 23, 2026 08:01
…d JSON-API

TeSS stores an event's start and end as local (wall clock) time in a
UTC column, with the zone in timezone. Bioschemas startDate/endDate
gave that time with Time#to_s ("2026-10-22 09:00:00 UTC", not ISO
8601) and JSON-API as "2026-10-22T09:00:00.000Z", both presenting the
local time as UTC: an event at 09:00 in Buenos Aires was given as 09:00
UTC rather than 12:00 UTC.

Give them in ISO 8601 with the offset of the event's time zone on that
date (Event#local_iso8601), e.g. "2026-10-22T09:00:00-03:00", or
without an offset, as local time, when the time zone is unknown. The
legacy JSON API is left unchanged.

See ElixirTeSS#1391

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TeSS stores event times as local (wall clock) time, with the zone in
the event's timezone. The iCalendar, Indico and Gray Scott ingestors
stored DTSTART;TZID=... times converted to UTC instead, so e.g. a
09:45 event in Perth was shown as 01:45 Perth time, and exported to
iCal and Google Calendar 8 hours early. All-day dates became midnight
in the server's time zone. Store the local time of the calendar
(Ingestor#ical_local_time). Upcoming events are corrected when their
source is ingested again.

The ingestor tests now check the actual UTC time (start_utc) and the
local time with its offset, rather than the stored column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new event form defaulted to 09:00-17:00 in the server's system
time zone (DateTime.now), giving e.g. 00:00-08:00 on a server in
Tokyo, and the event calendar used the server's date (Date.today).
Use the application time zone (Time.zone.now, Date.current).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Events without a time zone were exported to iCal and Google Calendar as
UTC, so e.g. a 09:00-17:00 event in Australia appeared from 20:00 to
04:00 the next day. Export them as floating local times
(DTSTART:20261105T090000), which calendars show at the same clock time
and day in their own time zone, assuming people are near the event. The
Google Calendar link now gives the IANA time zone (ctz=Australia/Perth
rather than Perth).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A short developer note on local (wall clock) storage with a separate
time zone, exports, default times, and what ingestors and their tests
need to do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant