Skip to content

Render schedules in a human-readable format - #66

Merged
dfalling merged 1 commit into
mainfrom
improve-schedule-rendering
Jul 27, 2026
Merged

Render schedules in a human-readable format#66
dfalling merged 1 commit into
mainfrom
improve-schedule-rendering

Conversation

@dfalling

Copy link
Copy Markdown
Owner

Summary

The element detail screen printed schedules as raw ISO fragments in a machine-ish order — 2026-03-14 – 2026-03-16 · 09:15:00–17:00:00. That reads as data, not as a plan. Times now lead and the day they fall on follows, with everything redundant dropped.

Case Before After
All-day, one day 2026-03-14 Mar 14
All-day range 2026-03-14 – 2026-03-16 Mar 14 to Mar 16
Timed, one day 2026-03-14 · 09:00:00–17:30:00 9 AM to 5:30 PM, Mar 14
Timed range 2026-03-14 – 2026-03-16 · 09:15:00–17:00:00 9:15 AM, Mar 14 to 5 PM, Mar 16
Start time only 2026-03-14 · 12:00:00 12 PM, Mar 14
End time only 2026-03-14 · 17:00:00 Until 5 PM, Mar 14

Details:

  • The year is omitted for the current year, and shown on both ends when either date falls outside it — so a New Year's range reads Dec 30, 2026 to Jan 2, 2027 rather than looking like it starts in 2027.
  • Same-day timed schedules mention the date once instead of on both sides.
  • Whole hours drop :005 PM, not 5:00 PM.
  • allDay: true suppresses any times still stored on the record from an earlier edit.
  • Dates are split by hand rather than parsed through Date, which would reinterpret the element's own timezone as the device's and slide the day.

Formatting moved out of ElementDetailScreen into src/map/formatSchedule.ts so it could be unit tested; times render 12-hour AM/PM with no locale awareness, matching the rest of the app.

The detail screen printed raw ISO fragments in a machine-ish order —
"2026-03-14 – 2026-03-16 · 09:15:00–17:00:00" — which reads as data, not
as a plan. Lead with the time and follow with the day it falls on, and
drop everything redundant: a shared date is written once, the year only
appears when the schedule isn't in the current year.

Dates are split by hand rather than parsed through Date, which would
reinterpret the element's own timezone as the device's and slide the day.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dfalling
dfalling enabled auto-merge (squash) July 27, 2026 13:30
@dfalling
dfalling merged commit a312654 into main Jul 27, 2026
2 checks passed
@dfalling
dfalling deleted the improve-schedule-rendering branch July 27, 2026 13:34
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