This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 4f8b7f8
fix(plugin-calendar,plugin-gantt): show a stored date-only day on that day and write a date field as the calendar day (objectui#10866, sites 1 and 2) (#10886)
Part of #10866
Clause-②: no
Every read goes through the existing `toDisplayDate`, and a write to a
`date` field sends the spec's own `YYYY-MM-DD` storage form. No declared
key, export or accept set moves. `@object-ui/types` changes one
description string.
## What changed
This is slice 1 of the date-only zone family's successor card: sites 1
and 2, per triage `5861646819` item 1. It covers the calendar and the
gantt, and in each plugin the reads and the writes change together.
Sites 3 to 6 are later slices, listed under Acceptance notes.
**Reads: every stored date-only value now goes through `toDisplayDate`
from `@object-ui/core`.** That function reads a date-only value at local
midnight of the day it names. A value with a time keeps its instant.
- plugin-calendar `ObjectCalendar`: the event `start` and `end`.
- plugin-calendar `calendar-view` renderer: each event's `start` and
`end`, and the authored `currentDate` (`resolveAuthoredCurrentDate`).
- plugin-gantt `ObjectGantt`: the task `start` and `end`, and
`baselineStart` / `baselineEnd` (new helper `readTaskDate`).
- plugin-gantt `GanttView`: a marker's `date`, in both the zoned
`markers` memo and `resolvedMarkers`, and the inline editor's committed
start and end.
**Writes: a `date` field is written as the calendar day.** This covers
the calendar drop (`handleEventDropDefault`), the calendar quick-create
(`submitQuickCreate`) and the gantt drag (`handleTaskUpdateDefault`).
- A field declared `date` is written as the local calendar day
`yyyy-MM-dd`, using core's `toDateInputValue`.
- Any other declared type (`datetime`) keeps `toISOString()`.
- With no object schema to ask, the stored value's own shape decides
(`isRealCalendarDate`). That is the same split the read makes, so the
read and the write cannot disagree.
- A quick-create has no stored value, so on a field with no declared
type it still writes the instant.
- New private helper `toStoredDateValue`, one in each plugin.
**The gantt `timeZone`.** The card asked for a decision on `tzShift`'s
treatment of a date-only value. The decision: a date-only day stands on
that day of the chart's own calendar, for every viewer, and a drop
writes the day of the chart's calendar it landed on.
- `GanttView` re-bases every `Date` it is handed into the business zone,
and translates every emitted change back.
- `ObjectGantt` therefore hands it the instant that re-bases onto the
named day's local midnight (`readTaskDate`). It reads a drop back
through the same shim before taking the local day (`toStoredDateValue`).
- A date-only marker is placed on its day and is not re-based.
- With no `timeZone` both halves are the identity. That is the
showcase's case and every chart's default.
- Two alternatives were not taken:
- A per-task "this is a day" flag on `GanttTask` would widen an exported
type (a public face, Clause-② yes).
- Leaving days re-based like instants puts the bar on the previous day
for any viewer east of the chart's zone.
**The gantt working calendar (`skipWeekends` / `holidays`,
`scheduling.ts`).** The scheduler floored to UTC midnight and keyed days
with `getUTCDay` / `toISOString()`. That only agreed with a date-only
value while the value was read as UTC midnight.
- It now floors to local midnight and steps by calendar day. It keys
days the way `GanttView`'s own column fold (`isWorkingColumn`) already
did.
- Left on UTC, a rescheduled successor landed a day early in every zone
except UTC (see H1).
**Also moved:**
- `makeTzShift` moved unchanged out of `GanttView.tsx` into a new
`plugin-gantt/src/tzShift.ts`, and `GanttView` re-exports it. The reason
is that `ObjectGantt` now calls it, and the `ObjectGantt` suites replace
`./GanttView` with a probe (`vi.mock('./GanttView', …)`). Imported from
there, it was undefined in each of those suites: the first full run went
red with `No "makeTzShift" export is defined on the "./GanttView" mock`.
- Two `ObjectGantt.test.tsx` cases pinned the defect. They expected a
drag to write `2024-02-01T00:00:00.000Z` into a field declared `date`
(on the api provider, a field stored as `2024-01-01`). They now expect
`2024-02-01`. Both carry a comment saying so.
- `@object-ui/types`: the `holidays` JSDoc and its zod `.describe()`
said the keys were UTC days. This change made that false, so both now
say calendar days on the chart's own calendar. This is an in-place fix
under the bounded exemption:
- It is the same defect class, a one-phrase fix.
- No open PR touches `objectql.ts` or `objectql.zod.ts`. I read the
open-PR file lists at 2026-09-28T02:18Z and again at 03:11Z; the only
file hit anywhere near this change is the release PR's CHANGELOGs.
- It uses the same gate family.
- The changeset names `@object-ui/types` as a `patch` for it.
**Fix round 1, at `687890effa`.** CI on `8ac7b62270` went red in `Test
(shard 7/8)` on the objectui#9909 locale census
(`machineLocaleCensus-9909.test.ts`). The contract review on that commit
asked for three more changes.
- **The census entry follows the shim.** Moving `makeTzShift` also moved
a DECLARED site: `tzOffsetMs`'s `en-US` `formatToParts` parser, which
never renders text. The census reported `GanttView.tsx · new
Intl.DateTimeFormat('en-US', { — declared 1, found 0` and an undeclared
`[en-US]` site in `tzShift.ts`. That `DECLARED` entry now names
`packages/plugin-gantt/src/tzShift.ts`. Its expression, count (1),
verdict and reason are unchanged. The root `vitest.config.mts` comment
that cited `tzOffsetMs` by its file is re-pointed the same way.
- **Literal-anchor sweep of the move.** I grepped tests, scripts and
ledgers for `GanttView.tsx` together with `makeTzShift`, `tzOffsetMs` or
`Intl.DateTimeFormat('en-US'`. The census entry and that config comment
were the only hits. The other `GanttView.tsx` ledgers
(`residue-namespaces-3546`, `gantt-count-interpolation-4157`,
`check-i18n-call-site-keys.mjs`) name i18n keys and union types, which
did not move.
- **`GanttViewProps.workingCalendar` (exported).** Its JSDoc still said
`holidays` were UTC keys. It now says they are calendar-day keys read on
the chart's own calendar: the viewer's, or the business `timeZone`'s
when one is set.
- **Other UTC working-day rule sites.** I swept plugin-gantt,
plugin-calendar, types, `content/docs` and `skills` for UTC wording
about holidays, weekends or working days. Two more encoded the retired
rule, and both now read the local day:
- `scheduling.test.ts`'s weekend count (`getUTCDay`). It is equivalent
under the suite's pinned `TZ=UTC`.
- `packages/plugin-gantt/scripts/verify-phase6b.mjs`'s weekend-start
check. This is a manual Playwright script, not run by CI; its browser
context sets no `timezoneId`, so the page and the script share one zone.
- **Changeset.** The Writes bullet now ends: a calendar quick-create has
no stored value, so there it still writes the instant. The frontmatter
is byte-identical.
- **Files this round:**
`packages/i18n/src/__tests__/machineLocaleCensus-9909.test.ts`,
`vitest.config.mts` (comment), `packages/plugin-gantt/src/GanttView.tsx`
(JSDoc), `packages/plugin-gantt/src/scheduling.test.ts`,
`packages/plugin-gantt/scripts/verify-phase6b.mjs` and
`.changeset/10866-calendar-gantt-date-only-days.md`.
## H1 and H2
**H1, measured on base.** The new pins were added over the base source
(`b93e245f9`, source unchanged) and run in the objectui#10183 driver's
forks child. Controls, west = `America/Los_Angeles`, east =
`Asia/Shanghai`:
- **Calendar, west.** `2026-10-05` sat in the `October 4, 2026` cell. A
two-day move wrote `'2026-10-07T00:00:00.000Z'`. A quick-create on the
12th wrote `'2026-10-12T07:00:00.000Z'`.
- **Calendar, east.** The read was already right. A move wrote
`'2026-10-07T00:00:00.000Z'`. A quick-create on the 12th wrote
`'2026-10-11T16:00:00.000Z'`, which names the 11th.
- **`calendar-view`, west.** `currentDate: '2026-11-01'` opened on
October, and `2026-11-05` sat on the 4th.
- **Gantt reads.** The task start read as year, month, day, hour `[2026,
10, 4, 17]` west and `[2026, 10, 5, 8]` east.
- **Gantt writes.** A drag wrote `toISOString()` instants into both
`date` fields.
- **Zoned charts.** A west viewer of a chart zoned `Asia/Shanghai` got
the bar at `[2026, 10, 5, 8]`. An east viewer of a chart zoned
`America/Los_Angeles` got `[2026, 10, 4, 17]`.
- **Markers.** A `2026-10-05` marker stood 32 px (west) and 37 px (east)
off the edge of a bar starting that day.
- **Inline editor.** A typed `2026-10-07` was committed as `[2026, 10,
6, 17]` west and `[2026, 10, 7, 8]` east.
- **Working calendar.** A successor of a Friday task landed at `[2026,
10, 11, 17]` (a Sunday) west, and at `[2026, 10, 9, 8]` (the Friday
itself) east.
- **`datetime` controls, green on base and on head.** The instant
`2026-10-06T04:00:00.000Z` sits on its local day in each zone. A two-day
move writes `2026-10-08T04:00:00.000Z` in both zones, and a gantt drag
keeps the instant.
**H2, the census.** It covers the non-test sources of both plugins,
searching for `new Date(`, `toISOString(` and `Date.parse(`. Neither
plugin imports a date-fns parse. Each site is classified by the field it
serves.
Date-only (a stored `Field.date` value, or an authored day). All are
fixed here:
- `ObjectCalendar`: event start and end; drop patch; quick-create
payload.
- `calendar-view` renderer: event start and end; `currentDate`.
- `ObjectGantt`: task start and end; baselines; drag patch.
- `GanttView`: marker date, 2 sites; inline editor start and end.
- `scheduling.ts`: the UTC day key and the UTC floor.
Datetime, or not a stored value, and so left as is:
- `ObjectGantt`: the tooltip's datetime sniff, which is a validity check
on a datetime-shaped string. The `new Date()` placeholder for a
date-less record. The `lockedRange` min/max copies.
- `CalendarView`: every `new Date(x)` copies a `Date`. Its props are
typed `Date`, and the day math uses local getters and multi-argument
constructors.
- `GanttView`: the `tzShift` shim, `now()`, copies and arithmetic. The
`startDate` / `endDate` props are typed `Date`.
- `calendar-view` renderer: the registry's sample events (demo data
built from `new Date()`).
- `ResourceWorkload`, `shifts.ts`, and the rest of `scheduling.ts`:
copies and millisecond arithmetic.
- `ObjectCalendar`: the clock (`useState(new Date())`, `handleCreate`).
## Pins and ablation
**Five new pins, registered in the objectui#10183 driver's `PINS`.**
- `ObjectCalendar.dateOnlyZone-10866.test.tsx`: the read cell, a two-day
move and a quick-create, with `datetime` controls.
- `calendarViewRenderer.dateOnlyZone-10866.test.tsx`: events and
`currentDate`.
- `ObjectGantt.dateOnlyZone-10866.test.tsx`: reads with baselines, the
drag payload, and a zoned chart read and written, with `datetime`
controls.
- `GanttView.dateOnlyZone-10866.test.tsx`: markers, unzoned and zoned,
and the inline editor.
- `scheduling.dateOnlyZone-10866.test.ts`: the weekend and a holiday.
How the pins run:
- Each zone opens with a rig case.
- The suite-zone cases also run in the normal run. They assert the
written shape, which UTC can tell apart.
**Red on base, green on head.** On base the driver gave `Tests 6 failed
| 8 passed (14)`: all 5 new pin rows plus the child-exit row, and the 8
existing pins stayed green. The failed cases were:
- every date-only read case, west, plus the east gantt read and markers;
- every date-only write case, both zones;
- both zoned-chart cases;
- both inline-editor cases;
- all 4 working-calendar cases.
The rigs and the `datetime` controls passed.
**Ablation (read routing reverted), at `f9ae4ebd7b`.** I committed
first, then used `ablation-replace.mjs --hold` with 10 anchors, each
asserted `x1 → x0` with a changed blob. They set every read above back
to `new Date(…)`: 2 in `ObjectCalendar`, 3 in the `calendar-view`
renderer, 1 in `readTaskDate`, and 4 in `GanttView`. No `dist` is
involved: the vitest root config resolves `@object-ui/*` to `src`, and
the plugin files are imported relatively. The driver went `Tests 5
failed | 9 passed (14)`.
- **Red:** the calendar read (west), the `calendar-view` read (west),
the gantt read in both zones, both zoned-chart cases, and all 4 marker
cases and both inline-editor cases.
- **Green:** every pure write case, meaning the gantt drag onto the 7th
in both zones, all quick-creates, and the calendar east move. All
`datetime` controls and the working calendar also stayed green.
- **One write row reddened, as a cascade: the west calendar move.** It
moves the event two days from the cell it was drawn in, so with the read
reverted it wrote `'2026-10-06'`. That is still a day, not an instant,
just one day early.
- **Restore.** Each file was restored with `git checkout HEAD --` to its
HEAD blob (`68688411c93a`, `26454aa22622`, `266f62c9ecdb`,
`257811400efc`), and `git diff HEAD` was empty.
## Gates
**Fix round 1, at `687890effa`.**
- **Census red reproduced first**, at `8ac7b62270` under the verify
lock: `Tests 2 failed | 5 passed (7)`, with exactly the two CI messages.
- **The census, now green.** Run under the lock with the zone-pin driver
and the 12 script pins that read `vitest.config.mts`: `Test Files 16
passed (16)`, `Tests 566 passed (566)`. The census alone gives `Tests 7
passed (7)`.
- **plugin-calendar + plugin-gantt**, under the lock: `Test Files 137
passed (137)`, `Tests 974 passed | 44 skipped (1018)`. That run does not
include the driver, which ran in the census run above.
- **Gates, each exit 0:** `check-changeset-presence` / `-no-major` /
`-claims` / `-fixed` / `-overwrite`, `check-pending-changeset-literals`,
`check-new-cross-file-line-citations` (`0 new citation(s)`),
`check-control-bytes` and `check-unreferenced-sources`.
`check-governed-queue-guard --test` over the 20 changed paths answers
NOT GOVERNED.
- **ESLint, narrowed:** the 5 files this round touched. 0 errors, and
each file's warning count equals its count at `8ac7b62270`.
- **NOT MEASURED: type-check, this round.** The re-created worktree has
no built dependency closure. The round's type-level change is
`getUTCDay` to `getDay` in one test; the rest is comments, one JSDoc and
a string path. CI's `Type Check` covers it.
**Round 0.** The gates and ESLint ran at `8ac7b62270`; the type-check
and the two package-suite runs name their own commit.
**Type-check, at `3587ab1a02`.** First the closure (`pnpm
--workspace-concurrency=2 --filter '@object-ui/plugin-calendar^...'
--filter '@object-ui/plugin-gantt^...' run build`: lock verdict
`command-exit 0`). Then `pnpm --workspace-concurrency=2 --filter
@object-ui/plugin-calendar --filter @object-ui/plugin-gantt --filter
@object-ui/types run type-check`:
- each package echoes its `type-check$ tsc --noEmit … && tsc -p
tsconfig.test.json` and prints Done;
- `pnpm type-check:scripts` exits 0;
- the gantt test project was re-run after the last commit, `tsc -p
tsconfig.test.json --noEmit`, exit 0.
The test tsconfigs include `src/**/*.test.ts(x)`.
**Suites.**
- At `3587ab1a02`: `pnpm exec vitest run packages/plugin-calendar/
packages/plugin-gantt/
scripts/__tests__/date-only-zone-pins-10183.test.ts` gave `Test Files
138 passed (138)`, `Tests 988 passed | 44 skipped (1032)`. The 44
skipped are the new zone cases, which run in the driver's child.
- `packages/types/` gave `Test Files 257 passed (257)`, `Tests 5482
passed (5482)`.
- The last commit only types the gantt pin. After it, the driver, the
five pins, `ObjectGantt.test.tsx` and `GanttView.tzshift.test.ts` gave
`Test Files 8 passed (8)`, `Tests 64 passed | 44 skipped (108)`.
**Gates, each exit 0.**
- `check-changeset-presence`, `-no-major`, `-claims`, `-fixed` and
`-overwrite`.
- `check-pending-changeset-literals`.
- `check-new-cross-file-line-citations`, which prints `VERDICT
new-cross-file-line-citations: 0 new citation(s)`.
- `check-control-bytes`, `check-test-path-roots`, and
`check-vi-mock-specifiers` / `-inherit` / `-override-shape`.
- `check-phantom-dependencies`, `check-unused-dependencies` and
`check-unreferenced-sources`.
- `check-governed-queue-guard --test` over the 16 changed paths answers
NOT GOVERNED.
**ESLint, narrowed.** The repo-wide run belongs to CI.
- **What was run:** the root `eslint.config.js` with `--no-inline-config
--format json` over the 15 changed code files; the JSON holds 15 file
results.
- **Result:** 0 errors. Each modified file's warning count equals its
base count (via `--stdin` on the base blob): `ObjectCalendar` 31, the
`calendar-view` renderer 1, `GanttView` 12, `ObjectGantt` 84,
`ObjectGantt.test.tsx` 30, `scheduling.ts` 0, `objectql.ts` 34,
`objectql.zod.ts` 1, the driver 0. The new files have 0 each.
- **Why narrowing is safe:** the config sets no `parserOptions.project`
or `projectService`, so it is not type-aware and this diff cannot move a
verdict on an untouched file.
**Pending changesets.** I read every pending changeset that names a file
or symbol this change touches. `check-changeset-claims` lists 35 by
file. None states the behaviour changed here: date reads, instant
writes, UTC holiday keys, or the zone shim. No note is owed.
## Serial
- **Claim.** The earliest live `Claim:` on the card is `5861874880`
(seat 2, this PR). A later claim, `5861881966` (seat 4, site 1 only),
names branch `claude/issue-10866-calendar-date-only`. That branch did
not exist on the remote when this one was cut, and nothing here touches
it.
- **Open PRs.** At 2026-09-28T02:18Z and again at 03:11Z, no open PR
touched `packages/plugin-calendar`, `packages/plugin-gantt`,
`packages/types/src/objectql.ts`,
`packages/types/src/zod/objectql.zod.ts` or the zone-pin driver, apart
from the release PR's CHANGELOG and `package.json` lines.
- **Merge order.** The next slices of #10866 register in the same `PINS`
list, so they are serial after this PR.
## Acceptance notes
**#10866 remains open; sites 3 to 6 are later slices.**
- `plugin-timeline`: `ObjectTimeline.dateBucket`, the sort, the
renderer's `formatDate` default face and the axis extent.
- `plugin-charts`: `AdvancedChartImpl.formatTick` and its
`toISOString()` fallback.
- Core `FormulaFunctions`: `DATEADD` / `DATEDIFF` / `DATEFORMAT` against
`TODAY()` / `NOW()`. Triage requires one zone decision, measured against
the server formula engine.
- The i18n helpers: `formatDate`, `formatDateTime`, `formatRelativeTime`
and `formatDateSpec`.
**Observed, not filed.** Each is a read-only inference, not measured.
- **Calendar drop across a DST change.** `CalendarView`'s move adds the
millisecond delta between two local midnights to the event's start.
Suppose an event starts on the 25-hour day (the first Sunday of
November, west), and is grabbed from a later cell of its span. The new
start then lands at 23:00 of the day before the target, and a `date`
field is written as that day. This is pre-existing arithmetic: a
`datetime` event moves by an hour on the same path.
- **Business-zone day placement near DST.** It inherits `makeTzShift`'s
per-instant offsets, which the shim documents as close rather than exact
near a DST transition in either zone.
- **Date-only end is exclusive.** A date-only gantt end reads as that
day's start, so the bar ends where the end day begins. This is unchanged
by this PR.
Written by the `domain:ui#2` dispatch, session
`https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 45dbf1c commit 4f8b7f8
20 files changed
Lines changed: 1310 additions & 105 deletions
File tree
- .changeset
- packages
- i18n/src/__tests__
- plugin-calendar/src
- __tests__
- plugin-gantt
- scripts
- src
- __tests__
- types/src
- zod
- scripts/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
316 | 319 | | |
317 | 320 | | |
318 | 321 | | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
319 | 346 | | |
320 | 347 | | |
321 | 348 | | |
| |||
882 | 909 | | |
883 | 910 | | |
884 | 911 | | |
885 | | - | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
886 | 917 | | |
887 | 918 | | |
888 | 919 | | |
| |||
893 | 924 | | |
894 | 925 | | |
895 | 926 | | |
896 | | - | |
| 927 | + | |
897 | 928 | | |
898 | 929 | | |
899 | 930 | | |
| |||
1028 | 1059 | | |
1029 | 1060 | | |
1030 | 1061 | | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
1031 | 1065 | | |
1032 | | - | |
| 1066 | + | |
1033 | 1067 | | |
1034 | 1068 | | |
1035 | | - | |
| 1069 | + | |
1036 | 1070 | | |
1037 | 1071 | | |
1038 | 1072 | | |
| |||
1067 | 1101 | | |
1068 | 1102 | | |
1069 | 1103 | | |
1070 | | - | |
| 1104 | + | |
1071 | 1105 | | |
1072 | 1106 | | |
1073 | 1107 | | |
| |||
1103 | 1137 | | |
1104 | 1138 | | |
1105 | 1139 | | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1106 | 1143 | | |
1107 | 1144 | | |
1108 | | - | |
| 1145 | + | |
1109 | 1146 | | |
1110 | 1147 | | |
1111 | 1148 | | |
1112 | | - | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
1113 | 1154 | | |
1114 | 1155 | | |
1115 | 1156 | | |
| |||
0 commit comments