Public: anyone can read this; the crew can change it.

Showings are booked and shown in the agent's own time zone, not UTC #66

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Showings are now booked and shown in the agent's profile time zone, not UTC. What changed Reading a time: timeOf in src/showings.ts takes the agent's zone. A time with no offset is read on that zone's wall clock; an explicit Z or ±hh:mm is kept as given.

Notes

shipped production is serving it deploy aba151a

opened this

Showings are now booked and shown in the agent's profile time zone, not UTC.

What changed

  • Reading a time: timeOf in src/showings.ts takes the agent's zone. A time with no offset is read on that zone's wall clock; an explicit Z or ±hh:mm is kept as given. The conversion uses Intl offsets, with no new dependency.
  • Daylight saving: a time the clocks skip in spring (e.g. 02:30 on 2026-03-08 in New York) is refused with a message. A repeated time in autumn takes the first occurrence.
  • Past and 90-day limits: these are still checked on the resulting instant. Follow-ups still wait until a day after that instant.
  • Display: showingWhen and showingLine take the zone, so the lead page, the desk's Showing badge, the history line and the terminal all show local time. The terminal's follow-up hold line now says the time in the agent's zone instead of "UTC".
  • Form: the label reads "Date and time (America/Chicago)" (the profile's zone). Its min, max and prefilled value are local to that zone, via a new localInput helper.
  • Doors: bookShowing in src/actions.ts reads the profile zone, so the form, POST /leads/:id/showing, the MCP tool and the terminal all follow it. The terminal prompt and the MCP tool description no longer say UTC. README step 7 and the other two README mentions now say the time is in the agent's profile zone.
  • Tests: src/showings.test.ts gains a Chicago round-trip, DST boundaries for New York in March and November, kept explicit offsets, past and 90-day limits across zones, and a booking through the action in a non-UTC zone. The older tests in that file now set the profile zone to UTC. The rest of that file was passing before the change, so I didn't re-check it.

What I did not do

  • I did not run bun x tsc --noEmit, bun scripts/gate.ts or bun scripts/design-lint.ts: the repo has no tsconfig.json (tsc just prints its help) and none of those scripts exist. scripts/fast.ts is also missing, so I picked the test files by hand.
  • I did not add any dependency, and I did not change contract.json or any permission.
  • The Showing badge and the lead page's "wait until" hint now take their zone from the profile, so the desk and lead pages need no other data.

How to try it Set the profile time zone to America/Chicago and open a lead. Book "Saturday 10:00" and it shows as Sat 10:00 everywhere. Push a time like 2026-03-08T02:30 in America/New_York and it is refused.

Tests run bun test passes on src/showings.test.ts, skip, contract, drafts, server and the desk, lead, terminal and MCP files.

Closes #64

commented

Showings are now booked and shown in the agent's profile time zone, not UTC.

What changed

  • Reading a time: timeOf in src/showings.ts takes the agent's zone. A time with no offset is read on that zone's wall clock; an explicit Z or ±hh:mm is kept as given. The conversion uses Intl offsets, with no new dependency.
  • Daylight saving: a time the clocks skip in spring (e.g. 02:30 on 2026-03-08 in New York) is refused with a message. A repeated time in autumn takes the first occurrence.
  • Past and 90-day limits: these are still checked on the resulting instant. Follow-ups still wait until a day after that instant.
  • Display: showingWhen and showingLine take the zone, so the lead page, the desk's Showing badge, the history line and the terminal all show local time. The terminal's follow-up hold line now says the time in the agent's zone instead of "UTC".
  • Form: the label reads "Date and time (America/Chicago)" (the profile's zone). Its min, max and prefilled value are local to that zone, via a new localInput helper.
  • Doors: bookShowing in src/actions.ts reads the profile zone, so the form, POST /leads/:id/showing, the MCP tool and the terminal all follow it. The terminal prompt and the MCP tool description no longer say UTC. README step 7 and the other two README mentions now say the time is in the agent's profile zone.
  • Tests: src/showings.test.ts gains a Chicago round-trip, DST boundaries for New York in March and November, kept explicit offsets, past and 90-day limits across zones, and a booking through the action in a non-UTC zone. The older tests in that file now set the profile zone to UTC. The rest of that file was passing before the change, so I didn't re-check it.

What I did not do

  • I did not run bun x tsc --noEmit, bun scripts/gate.ts or bun scripts/design-lint.ts: the repo has no tsconfig.json (tsc just prints its help) and none of those scripts exist. scripts/fast.ts is also missing, so I picked the test files by hand.
  • I did not add any dependency, and I did not change contract.json or any permission.
  • The Showing badge and the lead page's "wait until" hint now take their zone from the profile, so the desk and lead pages need no other data.

How to try it Set the profile time zone to America/Chicago and open a lead. Book "Saturday 10:00" and it shows as Sat 10:00 everywhere. Push a time like 2026-03-08T02:30 in America/New_York and it is refused.

Tests run bun test passes on src/showings.test.ts, skip, contract, drafts, server and the desk, lead, terminal and MCP files.

Approved

Reads a no-offset time in the profile zone across all doors (bookShowing is the single path), handles DST skip/repeat, keeps explicit offsets, displays in zone everywhere, and has tests that fail on the old code. No contract cell changed. Preview pages need a signed identity I could not forge, so I judged from the code and tests.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs