Conversation
Contributor
Code Metrics Report
Details | | main (45bdadf) | #546 (7556043) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 87.4% | 87.7% | +0.3% |
| Files | 204 | 204 | 0 |
| Lines | 6014 | 6046 | +32 |
+ | Covered | 5257 | 5305 | +48 |
+ | Test Execution Time | 2m11s | 1m38s | -33s |Code coverage of files in pull request scope (79.7% → 83.1%, patch 79.6%)
Reported by octocov |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Datetime handling remains inconsistent across configured timezones and operator changes, while permissive parsing can silently alter invalid values.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates DataTable datetime filters to use RFC 3339 instants while retaining local-time editing.
Changes:
- Normalizes datetime values during editing and submission.
- Displays persisted instants as local picker values.
- Adds documentation, tests, and release metadata.
File summaries
| File | Description |
|---|---|
packages/core/src/components/data-table/toolbar.tsx |
Applies datetime conversion in filter editors. |
packages/core/src/components/data-table/toolbar.test.tsx |
Tests datetime serialization and ranges. |
packages/core/src/components/data-table/filter-value-utils.ts |
Adds normalization and local-part helpers. |
packages/core/src/components/data-table/filter-value-utils.test.ts |
Tests normalization and picker hydration. |
docs/components/data-table.md |
Documents the RFC 3339 contract. |
.changeset/bright-clocks-wait.md |
Records the patch-level behavior fix. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
75
to
+76
| const date = toValidDate(trimmed); | ||
| return date ? formatLocalDateTime(date) : undefined; | ||
| return date ? date.toISOString() : undefined; |
Comment on lines
+47
to
+49
| /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?$/.test( | ||
| trimmedValue, | ||
| ) && toValidDate(trimmedValue) != null |
Comment on lines
+1957
to
+1962
| control.addFilter( | ||
| config.field, | ||
| localOp, | ||
| config.type === "datetime" | ||
| ? normalizeTemporalFilterValue("datetime", localValue) | ||
| : localValue, |
Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>
Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>
Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>
Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
DataTable.Filtersemitted local datetime strings without a timezone and passed them straight to GraphQL collection queries. PlatformDateTimefilters require RFC 3339 instants, so these values were not a reliable query contract.Design Decision
Local-time selection, instant serialization
The picker continues to present the user's local date and time. On input it converts that local selection to an RFC 3339 UTC instant with
Date#toISOString()rather than appendingZ, which would change the selected instant. Existing instants are converted back to local picker parts when displayed.Backward compatibility
Previously stored timezone-less datetime filters remain readable and are normalized when re-applied. Date and time filters retain their existing
YYYY-MM-DDandHH:mmformats.Summary