Skip to content

Calendar: event times, on the viewer's local day (#1802) - #1898

Closed
michielbdejong wants to merge 7 commits into
developfrom
claude/calendar-times
Closed

michielbdejong wants to merge 7 commits into
developfrom
claude/calendar-times

Conversation

@michielbdejong

Copy link
Copy Markdown
Contributor

Closes #1802

Stacked on #1896 (claude/calendar-repeat): both change the calendar's row dialog (CalendarRowFields), CalendarView and calendarRows. Merge #1896 first; until then the diff here includes it. The #1802 changes are the last two commits.

Decisions (Michiel, 25 Sep): an event belongs to the viewer's local day, like Google Calendar. Per #1803, existing properties keep their meaning; the exclusive End day is unchanged.

What changes

  • In the calendar's row dialog, All day is a checkbox; unchecking it reveals Start time and End time. A time is saved when its input loses focus (or on Enter). Checking All day again clears the times.
  • Chips show the local start time: "09:30 Dentist", "↻ 01:30 Boston sync". Timed rows sort after untimed ones within a day.
  • Timed events are placed on the viewer's local day and show local times: plain rows, native repeating rows, and imported timed recurrences with a time zone. The issue's case: a weekly Tuesday 19:30 America/New_York meeting shows on Wednesday 01:30 in Europe/Amsterdam (and at 00:30 in the week between the EU and US DST changes). Moved-instance placeholders ("Moved from …") use the viewer's day too.
  • All-day events are unchanged: date-only, exclusive end.

Where times are stored

In atomic-calendar-start / atomic-calendar-end, the properties the atomic-plugins Event ontology (ontology/classes/event-v1) already defines for exactly this: the exact start / exclusive end instant, as an RFC 3339 string with its UTC offset (a string rather than a timestamp, so the offset is kept). No existing property is reinterpreted:

  • Day still says which date. A timed row takes its date from Day and its time of day from Start, so moving Day in the table moves the event.
  • End day is left as it is; All day is set to false / true when the class has it.
  • A table that has no Start/End gets them added to its class (same shortnames, datatype and descriptions as the ontology) when a row first gets a time, the same way Calendar: a Repeat field instead of recurrence JSON (#1801) #1896 adds Recurrence. Nothing is created by opening the view.
  • Rows with an imported series keep the provider's times: the time fields are hidden for them.

New: browser/lib/src/calendar-time.ts, Calendar/EventTimeFields.tsx; useCalendarRecurrenceProp became useCalendarRowProps (recurrence + start + end).

Tests

  • Calendar/calendarOccurrences.test.ts: Tuesday 19:30 New York → Wednesday 01:30 for an Amsterdam viewer; Tuesday for a New York viewer; all-day events keep their dates and exclusive end in UTC+14 and UTC−11.
  • Calendar/calendarRows.test.ts: reading a timed row; an all-day row with a stray Start stays date-only; Day moves the time; a start without an end; writing/reading local wall times with their offset (DST).
  • Calendar/EventTimeFields.test.tsx (component): unchecking All day reveals the time inputs and stores nothing until a start is given; a timed row shows its times, and checking All day clears them.
  • Existing calendar vitest + e2e/tests/calendar.spec.ts pass.

Screenshots

Before / after, desktop and 375 px (Europe/Amsterdam, en-GB), shared with the developer in chat: 1802-before-dialog-{desktop,375}.png, 1802-before-calendar-{desktop,375}.png, 1802-after-1802-dialog-{desktop,375}.png, 1802-after-1802-calendar-{desktop,375}.png.

Questions for Michiel

  1. Default duration. Conservative default: an event with a start and no end time stores no end. Only to expand a repeating one does the calendar give it an hour internally (never stored). Should a new start time instead prefill an end (e.g. +1 hour, like Google)?
  2. Timestamp date columns. A table whose calendar date column is itself a timestamp (e.g. a "Due date" with time) still shows no time on its chips, because the calendar's "+" creates those at local noon and they would all read "12:00". Should such columns show their time?
  3. Cross-midnight events show on their start day only (as timed events did before). Should they also appear on the next day?
  4. Chip width at 375 px. The time takes most of a narrow cell ("09…"). Keep the time, or drop it below a width?

🤖 Generated with Claude Code

Michiel de Jong and others added 5 commits September 29, 2026 15:05
The row dialog opened from a calendar view shows a Repeat field instead
of the raw recurrence JSON: none, daily, weekly on chosen days, monthly
by date or nth weekday, or yearly, ending never, on a date or after N
times, with a summary in words. It writes the payload the view already
expands; a payload it cannot show reads as Custom, kept as is, with its
JSON one click away.

A table without a recurrence property gets one (shortname
atomic-calendar-recurrence, as in the Event ontology) when a row first
repeats. A row's own series (calendarId "atomic") follows the row's
date columns, so moving the row moves the series; imported payloads
stay the provider's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Playwright test makes an event repeat weekly from the row dialog and
checks it appears on the following weeks. The Custom hint moves into
its own component: inside its guard the extractor dropped it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setting undefined through Resource.set failed validation, so turning a
repeat off raised an error. Remove the value instead. The e2e test now
turns the repeat off again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Unchecking All day in a calendar row's dialog reveals a start and end
time. They are stored in atomic-calendar-start / atomic-calendar-end,
the exact-instant properties the atomic-plugins Event ontology already
defines (RFC 3339 strings with their offset), added to the class when a
row first gets a time. Day, End day and All day keep their meaning: Day
still says which date, the exclusive End day is untouched, and an
all-day row stays date-only.

Timed events, rows and imported timed recurrences alike, are placed on
the viewer's local day and show local times on their chips ("09:30
Dentist"); a Tuesday 19:30 New York meeting is Wednesday 01:30 in
Amsterdam.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong

Copy link
Copy Markdown
Contributor Author

Michiel's decision: a start time without an end time stores no end; the event shows as a point in time. This PR keeps that as implemented.

Michiel de Jong and others added 2 commits September 29, 2026 16:01
The table view's row dialog now shows the calendar's Repeat field for the
recurrence property instead of its raw JSON, with the JSON behind Show JSON.
It uses the calendar's detection (`atomic-calendar-recurrence` or the
imported `lt-google-calendar-property-` one) and repeats from the calendar's
Day, else the class's first date column. A table creates no property: a
class without a recurrence or date column, or a row without a day, keeps the
JSON editor. The recurrence cell shows the Repeat summary, read-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the table view's Repeat field (#1801). Resolves the CalendarView
import conflict (calendarRangeColumns now finds All day / End day), moves
useTableCalendarRow to useCalendarRowProps, and keeps the table's row dialog
to the Repeat field only (`repeatOnly`): Start and End are table columns of
their own, and the table creates no property.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong

Copy link
Copy Markdown
Contributor Author

Michiel's decision: the table view's row dialog does not get the time fields (All day, Start, End), because the table has its own columns. The repeatOnly flag in useTableCalendarRow.ts stays as it is.

@joepio

joepio commented Sep 30, 2026

Copy link
Copy Markdown
Member

Trekmeester review (not batched tonight; this needs maintainer sign-off, since it's a stored-format change):

  • Bug: shiftInstantDays in browser/lib/src/calendar-time.ts (used by calendarRowTime when Day moves) keeps the old UTC offset. 09:30+02:00 moved from October into November then shows as 08:30 CET. Re-zone instead: take the PlainDateTime in the stored zone, add the days, then toZonedDateTime(zone).
  • Two sources of truth: Start isn't rewritten when Day moves.
  • Data format: it stores RFC 3339 strings with an offset in atomic-calendar-start/-end and auto-creates those properties on the class. Needs a decision from Joep/Polle/Michiel.
  • It's stacked on Calendar: a Repeat field instead of recurrence JSON (#1801) #1896 and conflicts in the four .po files (fixed by re-extracting).

joepio commented Oct 5, 2026

Copy link
Copy Markdown
Member

Landed on develop in the combined batch #2060 (95707c0), tested together in one full run. Closing as included.


Generated by Claude Code

@joepio joepio closed this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

browser enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar: events have no time of day

2 participants