Skip to content

Add the Time app: Find a time, Convert and Duration - #26

Merged
PeterHewat merged 10 commits into
mainfrom
time-app
Oct 13, 2026
Merged

PeterHewat merged 10 commits into
mainfrom
time-app

Conversation

@PeterHewat

Copy link
Copy Markdown
Owner

Adds Time (stable), the next app on the roadmap: find a call time for people in several zones, convert timestamps and dates across zones, and measure durations and ages. Described in docs/apps/time.md.

Time

  • Find a time (first view): people with weekly windows (preferred / acceptable / unavailable) and date exceptions in their own zones; suggestions ranked by the worst person's inconvenience, then the total; a timeline per person where the call can be clicked or dragged; never a time already past; correct across clock changes (a window in a repeated hour counts twice, a skipped hour does not exist); share links (#plan=).
  • Convert: Unix seconds/ms (unit buttons rewrite the value, same instant), ISO 8601, HTTP/email dates, batch lines, pinned zones; JWT opens Time on a token's time claims.
  • Duration: From/To, either one Now; calendar span with next anniversary, elapsed totals.
  • Saved people and share links are a released format (PLAN_VERSION); a plan from a newer version is refused, not misread.

Across the site

  • Dates are typed YYYY-MM-DD and times 24-hour in every app, whatever the browser's language: @tools/ui time-fields.ts (.ui-date / .ui-clock), used by Time and Codes; JWT and SVG format times with hourCycle: "h23". AGENTS.md records the rule.
  • JSON's view dropdown styles moved to @tools/ui (second user).
  • withIcons fills an icon whose closing tag Prettier wrapped (</svg\n>), which shipped blank before.
  • A reload paints the view the tab was on from the start (Time, and JSON's header).

Checks

bun run verify and the full browser suite (Chromium and WebKit) pass locally.

🤖 Generated with Claude Code

PeterHewat and others added 10 commits October 13, 2026 21:52
Starting point taken from the test_2 run, moved onto current main
(typecheck with bun check, lockfile refreshed).

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

- A window is now read one offset at a time (offsetSpans in zone.ts). In an
  hour the clocks repeat, a window is there twice with the gap between left
  out, rather than one stretch from its first start to its last end, which
  let a call run through time nobody marked. In a skipped hour, only the part
  that does not exist is dropped, not the whole window.
- The whole call ends within the dates searched.
- No suggestions while someone's zone is unknown: times found without them
  read as times that suit everyone.
- A saved plan or share link with a higher version than this page knows is
  not read as this one; saved people are left untouched and the page says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ch suggestion

- Unix input is read from its digits: 1.001 seconds was 1000 ms after
  floating-point multiplication. Digits past milliseconds are now noted for
  Unix times too, as they already were for ISO dates.
- Each Find a time suggestion lists everyone's own clock at the start, with
  their date where it differs from the one shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24-hour clock, in every app:
- Times are formatted with hourCycle h23 whatever the browser's language
  (Time, JWT's claim dates, the SVG app's document list).
- Times of day are typed .ui-clock fields (@tools/ui clock.ts: parseClock,
  formatClock, bindClockFields), never native time or datetime-local fields,
  which follow the language into AM/PM. Time and Codes (an event's start and
  end, each a date and a time) use them; moved to the shared package now that
  a second app needs it. AGENTS.md says so.
- Time's 12/24 setting and its Settings menu go; old saved prefs still read.
  The header was measured again: compactHeader 450, views to a dropdown below
  363px.

Find a time: a window is two lines, its remove button in the corner; a
chevron shows a person folds; the example is two people in two zones with one
window each, and a new person one window.

Convert: Now writes the unit chosen; the date and time pickers update the
input as they change, not once the picker closes.

Duration: no presets, just From and To with Now (To starts on Now); the
next-anniversary line serves any past date; Elapsed drops Weeks and says each
line is the whole span in that unit; an unreadable time says so instead of
counting from midnight.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Dates are typed YYYY-MM-DD fields across the site, as times are 24-hour
  ones: @tools/ui's time-fields.ts (was clock.ts) adds .ui-date with
  parseIsoDate / formatIsoDate, and a field written out in full on leaving
  tells the page with an input event. Time and Codes use them.
- Find a time is the first view, and a new tab opens on it.
- A person is removed with a red bin beside the chevron, over the card's
  row rather than inside its summary, so it works folded or not.
- The example and a new person keep business hours: 09:00 to 17:00 on
  weekdays, Alex in Paris and Sam in New York.
- The call is placed on the best suggestion until someone places it
  themselves; new dates or an opened link put it back.
- Convert: Seconds and Milliseconds rewrite the timestamps typed in that
  unit, the same instant, instead of reading the digits again.
- Duration: only one end can be now; switching one on frees the other.
- The tab's draft is also saved as the page is left, so a reload just after
  an edit keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Suggestions fold to their heading and count, open by default: the heading
  is a disclosure button and its whole row takes a click; kept in the draft.
- A reload no longer shows Find a time for a moment before the view the tab
  was on: a script in the head reads the draft and marks <html> with the
  view (and Suggestions folded) before the body paints; the page's styles
  show the view from that, and a second small script presses its header
  button. main.ts keeps the attributes from then on.
- @tools/ui withIcons fills an icon whose closing tag Prettier wrapped
  (</svg\n>); it was skipped silently, shipping a blank icon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…N's view from the first paint

- Time: pressing on the timeline places the call and dragging moves it live,
  a quarter hour at a time; grabbed on the call, it keeps its hold. Pointer
  capture stays with the timeline's container as the rows are drawn again.
- Time: the legend names the call (the outlined box) and now (the red line).
- Time: Suggestions start folded, since the call is already placed on the
  best one; opened, they stay open in the tab. Why nothing fits moves out of
  the fold, so it shows either way.
- JSON: a reload pressed the JSON view button for a moment before the view
  kept in the settings. A script after the header presses the right one from
  the first paint, as Time does; tested with the app's script blocked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The search covered whole days from midnight, so today's suggestions began
hours behind the clock. It now starts at the next quarter hour from now, says
so when no time is left in its dates, and searches again as each quarter hour
passes while the page is open. A call placed in the past by hand says so.

The browser tests run Find a time at a fixed moment (page.clock), the evening
before the day they search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI on Linux failed what passed on Windows:
- Linux fonts make the full Time header 482px (450px on Windows), so
  compactHeader is 482, and the views become a dropdown below 400px rather
  than 363px (measured on Windows, plus what Linux adds; the header test
  checks 390px and 420px).
- WebKit on Linux writes a short date "Mon, 12 Oct", others "Mon 12 Oct":
  the browser tests accept either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PeterHewat
PeterHewat merged commit 2bffb6f into main Oct 13, 2026
4 checks passed
@PeterHewat
PeterHewat deleted the time-app branch October 13, 2026 22:36
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