This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 6650259
fix(plugin-calendar): a day event moved across a DST change writes the days it was dropped on; timeZone prose and zone pins (objectui#10866, slice 4) (#10994)
Part of #10866
Clause-②: no
Slice 4 of objectui#10866: the items slice 1 left owed (claim
`5870315836`, release `5870108114`). The binding reading is the
release's: a calendar day reads and moves on the UTC calendar; a
`datetime` keeps its instant and is displayed in the viewer's zone. No
instant behaviour moves here.
## What changes
1. **The calendar's DST-day move: measured, and it moved stored days, so
it is repaired.** The month grid moves each date of an event by the
milliseconds between two local midnights, the grabbed cell's and the
drop cell's, and a date-only value is read at local midnight of its day.
When a DST change lies between one of the event's dates and where it
lands, but not between the two cells (or the other way round), that date
comes back an hour off local midnight; at 23:00 of the day before, the
write took the day before. Measured under `America/Los_Angeles` through
`ObjectCalendar`: four of ten day moves across November 1st and March
8th wrote a day one short (an October 29th to 31st span moved two days
wrote its end `2026-11-01`; a November 1st to 3rd span grabbed on the
2nd and moved one day wrote its start `2026-11-01`; an October 31st to
November 2nd span grabbed on the 2nd and moved back one day wrote its
start `2026-10-29`; a March 5th to 9th span moved back one day wrote its
end `2026-03-07`). `Asia/Shanghai` and UTC wrote every day right.
- `ObjectCalendar` now writes a `date` field of a **day event** (its
start, and its end when it has one, are both stored calendar days) as
its stored day moved by the whole days the grid moved it, on the UTC
calendar (`toMovedDateValue`). Every other write takes the path it took
before.
2. **The `timeZone` prose**, made true of the code at three sites plus
one comment of the same sentence:
- `@object-ui/types` `GanttConfig.timeZone`: a `datetime` value stays a
real instant; a `date` value is a calendar day, drawn from that day's
midnight in the chart's zone and written back as the day it was dropped
on, `YYYY-MM-DD`; near a DST change of the chart's zone or the viewer's,
that midnight can be placed an hour early, onto the day before
(measured, see Acceptance notes).
- plugin-gantt `GanttViewProps.timeZone`: dates handed to `onTaskUpdate`
are translated back into real instants; for a date-only value the host
translates both ways itself, as `ObjectGantt` does.
- `makeTzShift`'s JSDoc: what `from` gives back, how `ObjectGantt` hands
a day in and writes it back, and that `to` and `from` are exact inverses
except near a DST change of either zone. The old sentence "fixed-offset
zones (Asia/Shanghai) are exact" was false for a viewer whose own zone
keeps DST (measured on a verbatim copy of the function: for an
`America/Los_Angeles` viewer of an `Asia/Shanghai` chart, 31 of 2026's
hourly instants do not round-trip, all around March 8th and November
1st), so it is replaced rather than kept.
- The comment above `GanttView`'s `onTaskUpdate` wrapper said "writes
must persist real time"; it now says the host decides what to persist.
Same sentence class, same file, comment only.
3. **Zone pins**, registered in the driver's `PINS`:
- `ObjectCalendar.dstDayMove-10866`: the ten day moves in Los Angeles
and Shanghai, three `datetime` controls in Los Angeles and one in
Shanghai, a rig case per zone, and a fixture-validity case (November 1st
is 25 hours long in Los Angeles, March 8th 23).
- `ObjectCalendar.endDateNoSchemaZone-10866`: the `endDateField` write
(move, end-handle drag, quick-create), and the calendar with no object
schema (read, move, end drag, quick-create), with `datetime` controls,
in the suite zone, Los Angeles and Shanghai.
- `ObjectGantt.noSchemaZone-10866`: the gantt with no object schema, for
an adapter with no `getObjectSchema` and for one whose schema has no
fields (the `api` provider's shape): read, drag write, a zoned chart,
and an instant control, in the suite zone, Los Angeles and Shanghai.
4. **One `FormulaFunctions` docblock sentence**: a mixed `DATEDIFF`, one
day and one instant, reads each argument by its own kind when it counts
months or years, the day on the UTC calendar and the instant in the zone
the formula runs in. Comment only.
5. **The day-scale gantt misalignment rides nowhere here.** Measured not
small: the header row is equal-width columns (one per bucket, the end
inclusive) while every bar is a percentage of the continuous
minimum-to-maximum span. Read in `generateTimeScaleHeaders` and
`calculateBarDimensions` (not driven), the hour, week and month scales
are built the same way, so the choice (an inclusive end, or an axis
stretched to the last bucket's end) is a design decision across every
scale, and it moves the bar percentages slice 3's gantt pin asserts.
Reported below.
## Why the repair sits in `ObjectCalendar`, not in the grid
The grid cannot tell a day from an instant at local midnight, and the
calendar's own month-view quick-create writes exactly such an instant
into a `datetime` field. Every grid-side repair that makes a day exact
also moves those instants, which this slice may not do. `ObjectCalendar`
knows the field's declared type (or, with no schema, the stored value's
shape), and a day event can only be dragged in the month grid: the week
and day views draw it in their all-day row, which has no drag handlers.
So the day event's `date` fields are written from their stored day, and
the grid's arithmetic is untouched. The instant-side defect this leaves
standing is in the Acceptance notes.
## Instants are byte-equal to the base
A probe drove 19 moves through `ObjectCalendar` in UTC, Los Angeles and
Shanghai, against the base source and against this head. The only rows
that differ are the four Los Angeles day moves above. The nine instant
and mixed rows (`datetime` spans, a local-midnight `datetime` span, a
one-day `datetime` event, a `date` start with a `datetime` end, `date`
fields holding instants, `datetime` fields holding days) are equal in
UTC and Los Angeles; in Shanghai five of them were measured equal, and
four were not measured there (their grab cell names a day the instant
does not fall on in that zone, and they errored the same way on base and
head). The pin's `datetime` controls hold the same instants on both.
## Evidence
- **New pins, red on base then green.** The three pins in a forks child
with `OBJECTUI_DATE_ZONE_CHILD=1`, `ObjectCalendar.tsx` checked out from
the base: `Tests 4 failed | 84 passed (88)`, the four red rows exactly
the four day moves named above (`"end": "2026-11-01"` for
`"2026-11-02"`, `"start": "2026-11-01"` for `"2026-11-02"`, `"start":
"2026-10-29"` for `"2026-10-30"`, `"end": "2026-03-07"` for
`"2026-03-08"`). Restored by `git checkout HEAD --`, blob equal to HEAD,
`git diff HEAD` empty. Head: `Tests 88 passed (88)`.
- **The coverage pins can fail.** The end-date, no-schema calendar and
no-schema gantt paths were already right on the base, so those rows pass
there by design. Four ablations on the committed head through
`ablation-replace.mjs`, each anchor hit once, each blob changed and
restored to HEAD:
- the calendar's stored-shape arm answering `false`: `6 failed | 30
passed (36)`, the no-schema move and end-drag rows in all three zones;
- the calendar's end write as `toISOString()`: `33 failed | 31 passed
(64)` over the end-date and DST pins;
- the gantt's stored-shape arm answering `false`: `9 failed | 15 passed
(24)`, the drag writes and the zoned drop in all three zones;
- the gantt read through the engine parse: `6 failed | 18 passed (24)`,
the Los Angeles and Shanghai reads and zoned cases.
- **Suites at head `4dddfff0b`**, each under the shared verify lock:
`packages/plugin-calendar/` `Test Files 54 passed (54)`, `Tests 363
passed | 70 skipped (433)`; `packages/plugin-gantt/` `Test Files 86
passed (86)`, `Tests 630 passed | 43 skipped (673)`; the zone-pin driver
`Tests 23 passed (23)`; `packages/types/` `Test Files 270 passed (270)`,
`Tests 5977 passed (5977)`; `packages/core/` `Test Files 184 passed
(184)`, `Tests 3658 passed | 27 skipped (3685)`; the 38 test files
outside those packages that name a touched file or a touched plugin's
source directory `Test Files 34 passed | 4 skipped (38)` (the four
skipped are other slices' zone pins, which run in the driver's child);
the 48 `scripts/__tests__` files that mention `.changeset` or enumerate
files (`ls-files`, a glob, a directory walk) `Test Files 48 passed
(48)`, `Tests 1899 passed (1899)`.
- **Type-check**: the two plugins' dependency closure built, then
`type-check` for plugin-calendar, plugin-gantt, types and core, each
echoing `type-check$ tsc --noEmit ... && tsc -p tsconfig.test.json` and
`Done`; `tsc -p tsconfig.test.json --listFiles` includes all three new
pins.
- **Gates**: `check-changeset-presence` (`8 source file(s) of 4 released
package(s) changed, and this change declares 1 changeset(s)`),
`-no-major`, `-fixed`, `-overwrite`, `-claims` (report-only; no pending
changeset repeats the "real instants" sentence),
`check-pending-changeset-literals`, `check-control-bytes`,
`check-new-cross-file-line-citations` (`0 new citation(s)`),
`check-test-path-roots`, the three `check-vi-mock-*`,
`check-unreferenced-sources`: all exit 0. A control-byte scan of the
changed files finds none. `check-governed-queue-guard --test` over the
ten paths: NOT GOVERNED.
- **Lint, narrowed and stated as a narrowing**: the root config with
`--no-inline-config --format json` over the nine changed code files
(nine results): 0 errors; each modified file's warnings equal its base
blob's (`ObjectCalendar.tsx` 31, `GanttView.tsx` 12, `objectql.ts` 34,
`FormulaFunctions.ts` 26); the new files and `tzShift.ts` 0. The config
sets no `parserOptions.project` or `projectService`, so linting is not
type-aware and this diff cannot move an untouched file's verdict.
Repo-wide lint is CI's.
- **Bundle**: no import added; plugin-calendar and plugin-gantt load
through `registerLazy`, outside the console's eager closure. `Bundle
Analysis` is read from CI.
- **Serial**: this seat's open PR objectui#10962 edits two comment
blocks in `ObjectCalendar.tsx` and one in `types/src/objectql.ts`; every
hunk here stays at least 16 lines clear of them, and `git merge-tree` of
this head with that PR's head is clean.
## Acceptance notes
Recorded here, not filed by the dev; the seat decides.
- **The zoned gantt's day can move on a DST day (new measurement, this
card's family).** With a business `timeZone`, a viewer whose own zone
keeps DST, and a chart zone with a different DST, `makeTzShift`'s round
trip puts a day's midnight at 23:00 of the day before on a DST day: an
`America/Los_Angeles` viewer of an `America/New_York` chart sees a
stored `2026-03-08` drawn from 23:00 on March 7th, and a drop onto March
8th writes `2026-03-07`; the same with an `Europe/Berlin` chart on March
29th. A Shanghai viewer of a New York chart is exact on those days.
Measured through `ObjectGantt` with the `GanttView` probe. The repair is
not the family's shared step (it is the shim's inverse, for days only),
so it is not made here; no named producer sets a gantt `timeZone`.
- **A `datetime` event at local midnight moved across a DST change in
the month grid lands in the cell before the drop (instant path,
unchanged here).** Measured in Los Angeles: a `datetime` span starting
`2026-11-01T07:00:00.000Z` (local midnight), grabbed on November 2nd and
dropped on November 3rd, writes its start `2026-11-02T07:00:00.000Z`,
which is 23:00 on November 1st. The calendar's own month-view
quick-create writes such local-midnight instants into a `datetime`
field. Repairing it moves instants, so it needs its own ruling.
- **Day-scale gantt misalignment (pre-existing, zone-independent).** The
timeline's gantt variant draws one equal-width header column per bucket,
end inclusive, and places bars as percentages of the minimum-to-maximum
span, so on the day scale the bars sit on a scale one column narrower
than the headers, and the other scales disagree with their buckets too.
Dedupe words: `timeline gantt header column bar percentage`,
`generateTimeScaleHeaders calculateBarDimensions`, `day scale
misaligned`.
- **Cross-repo half, not edited here.** objectstack
`packages/spec/src/ui/view.zod.ts`, `GanttConfig` `timeZone` describe,
which `@object-ui/types`' zod mirror reuses, still says "persisted data
stays real instants".
- **A pending changeset sentence this slice's measurement contradicts.**
Slice 1's `.changeset/10866-calendar-gantt-date-only-days.md` says a
zoned chart's drop "writes the day of the chart's calendar that the bar
was dropped on"; the first note above measures a case where it writes
the day before. Not edited here: it is another slice's release
declaration, and `check-changeset-overwrite` reports a change that
modifies one. It publishes at the next release.
Commits carry the model-free trailer pair only.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01DuWo5bdP9SdVebamn99GGk)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1f5a644 commit 6650259
10 files changed
Lines changed: 942 additions & 17 deletions
File tree
- .changeset
- packages
- core/src/evaluator
- plugin-calendar/src
- __tests__
- plugin-gantt/src
- __tests__
- types/src
- scripts/__tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
281 | 284 | | |
282 | 285 | | |
283 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
344 | 388 | | |
345 | 389 | | |
346 | 390 | | |
| |||
1060 | 1104 | | |
1061 | 1105 | | |
1062 | 1106 | | |
1063 | | - | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1064 | 1110 | | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
1065 | 1114 | | |
1066 | | - | |
| 1115 | + | |
1067 | 1116 | | |
1068 | 1117 | | |
1069 | | - | |
| 1118 | + | |
1070 | 1119 | | |
1071 | 1120 | | |
1072 | 1121 | | |
| |||
0 commit comments