Uh oh!
There was an error while loading. Please reload this page.
fix(tables): canonicalize date cells, render times in effective timezone - #5465
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview CSV import (sync, async, and background jobs) accepts an optional The grid and row modal gain date + time editing ( Reviewed by Cursor Bugbot for commit 11a9151. Bugbot is set up for automated code reviews on this repo. Configure here. |
Uh oh!
There was an error while loading. Please reload this page.
Greptile SummaryThis PR replaces the previous "store-as-ISO, display in viewer's timezone" model for table date cells with a wall-clock-faithful canonical form: calendar dates stay as
Confidence Score: 5/5The change is safe to merge. The core date canonicalization logic is well-tested and correct; all three previously identified bugs (midnight guard, rolled-over calendar days, UTC-day highlighting) are fixed. The new No files require special attention. The only minor items are doc-comment consistency in Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant UI as UI (browser)
participant Utils as utils.ts
participant Dates as dates.ts
participant Server as API route
participant DB as Database
Note over UI,DB: Write path (inline editor / row modal / paste)
UI->>Utils: displayToStorage(draft, timeZone)
Utils->>Dates: "normalizeDateCellValue(raw, {timezone})"
Note right of Dates: explicit offset → preserve as-is<br/>naive datetime → stamp with zone offset<br/>date-only → YYYY-MM-DD
Dates-->>Utils: canonical (2026-07-06T16:04:55-07:00)
Utils-->>UI: canonical value
UI->>Server: "PATCH /table/{id}/row"
Server->>Dates: normalizeDateCellValue(value)
Dates-->>Server: normalized
Server->>DB: INSERT canonical value
Note over UI,DB: Read / display path
DB-->>UI: stored value
UI->>Dates: "formatDateCellDisplay(stored, {seconds})"
Note right of Dates: YYYY-MM-DD → MM/DD/YYYY<br/>T00:00:00Z → UTC day (legacy)<br/>offset instant → literal wall time
Dates-->>UI: 07/06/2026 4:04 PM
Note over UI,DB: CSV import path
UI->>Server: "POST /import {file, timezone}"
Server->>Dates: "normalizeDateCellValue(cellValue, {timezone})"
Note right of Dates: naive Excel/Sheets value stamped with user zone
Dates-->>Server: canonical
Server->>DB: INSERT canonical value
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant UI as UI (browser)
participant Utils as utils.ts
participant Dates as dates.ts
participant Server as API route
participant DB as Database
Note over UI,DB: Write path (inline editor / row modal / paste)
UI->>Utils: displayToStorage(draft, timeZone)
Utils->>Dates: "normalizeDateCellValue(raw, {timezone})"
Note right of Dates: explicit offset → preserve as-is<br/>naive datetime → stamp with zone offset<br/>date-only → YYYY-MM-DD
Dates-->>Utils: canonical (2026-07-06T16:04:55-07:00)
Utils-->>UI: canonical value
UI->>Server: "PATCH /table/{id}/row"
Server->>Dates: normalizeDateCellValue(value)
Dates-->>Server: normalized
Server->>DB: INSERT canonical value
Note over UI,DB: Read / display path
DB-->>UI: stored value
UI->>Dates: "formatDateCellDisplay(stored, {seconds})"
Note right of Dates: YYYY-MM-DD → MM/DD/YYYY<br/>T00:00:00Z → UTC day (legacy)<br/>offset instant → literal wall time
Dates-->>UI: 07/06/2026 4:04 PM
Note over UI,DB: CSV import path
UI->>Server: "POST /import {file, timezone}"
Server->>Dates: "normalizeDateCellValue(cellValue, {timezone})"
Note right of Dates: naive Excel/Sheets value stamped with user zone
Dates-->>Server: canonical
Server->>DB: INSERT canonical value
Reviews (2): Last reviewed commit: "fix(tables): address review — preserve m..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 992f362. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
…lendar days, effective-zone Today
TheodoreSpeaks
commented
Jul 7, 2026
@greptile review |

Summary
YYYY-MM-DDcalendar dates (timezone-free) and RFC 3339 instants with preserved offset (2026-07-06T16:04:55-07:00) — server coercion and CSV import normalize on write, legacy rows self-heal07/06/2026 4:04 PM, seconds when present) — no per-viewer conversion; the offset suffix keeps filters/sorts/agents on the true instantCalendarsingle mode gainsshowTime(mirrors range mode) — inline cell editor gets a time field, day picks preserve the existing time instead of silently dropping it; row modal usesChipDatePicker+ChipTimePickerCalendarhighlighting the UTC day for ISO instant values, anddisplayToStorageaccepting rolled-over dates like 02/30Type of Change
Testing
Unit tests for the canonical date module (offset preservation, zone stamping, DST, exporter wire formats) and the display/parse round-trips — wall-clock display assertions are now deterministic across runner timezones; full lint, type-check,
check:api-validation:strictpass. Inline editor focus/blur behavior needs a manual browser pass.Checklist