Repository navigation
Conversation
m4tx
requested review from
ElijahAhianyo and
seqre
and
a balanced review from Copilot
October 16, 2026 07:06
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Serialization can shift values with configured timezones and silently discard milliseconds.
2 open findings
What changed in this PR
Updates chrono form serialization to prevent browsers from displaying empty datetime inputs when editing existing values.
Changes:
- Uses browser-oriented datetime and time formats.
- Serializes timezone-aware datetimes in UTC.
- Adds serialization and round-trip tests.
| File | Description |
|---|---|
| cot/src/form/fields/chrono.rs | Updates chrono value formatting and adds regression tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
| Project | cot |
| Branch | fix-chrono-fields |
| Testbed | github-ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result microseconds (µs) (Result Δ%) | Upper Boundary microseconds (µs) (Limit %) |
|---|---|---|---|
| empty_router/empty_router | 📈 view plot 🚷 view threshold | 7,997.20 µs(-34.96%)Baseline: 12,296.05 µs | 18,508.91 µs (43.21%) |
| json_api/json_api | 📈 view plot 🚷 view threshold | 564.16 µs(-43.96%)Baseline: 1,006.77 µs | 1,345.38 µs (41.93%) |
| nested_routers/nested_routers | 📈 view plot 🚷 view threshold | 572.23 µs(-39.83%)Baseline: 951.05 µs | 1,254.98 µs (45.60%) |
| single_root_route/single_root_route | 📈 view plot 🚷 view threshold | 523.13 µs(-42.52%)Baseline: 910.18 µs | 1,209.60 µs (43.25%) |
| single_root_route_burst/single_root_route_burst | 📈 view plot 🚷 view threshold | 12,100.00 µs(-28.02%)Baseline: 16,811.28 µs | 22,263.31 µs (54.35%) |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
m4tx
force-pushed
the
fix-chrono-fields
branch
from
October 16, 2026 07:44
a5060c3 to
35148e4
Compare
Comment on lines
+412
to
+413
| let tz = self.custom_options.timezone.unwrap_or(Tz::UTC); | ||
| format_browser_datetime(&date_time.with_timezone(&tz).naive_local()) |
| /// when rendering the `datetime-local` input. | ||
| fn to_field_value(&self) -> String { | ||
| self.to_string() | ||
| self.to_rfc3339_opts(SecondsFormat::Millis, false) |
Datetime and time values were rendered with `Display`, producing values like `2025-05-27 12:34:56.789 +00:00` that `<input type="datetime-local">` rejects. Browsers then showed an empty input, so re-submitting a form (e.g. editing an object in the admin panel) silently cleared the field.
m4tx
force-pushed
the
fix-chrono-fields
branch
from
October 19, 2026 22:54
a115cf9 to
460f013
Compare
This branch has not been deployed
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.


Description
Datetime and time values were rendered with
Display, producing values like2025-05-27 12:34:56.789 +00:00that<input type="datetime-local">rejects. Browsers then showed an empty input, so re-submitting a form (e.g. editing an object in the admin panel) silently cleared the field.Type of change