DateTime: user-local display/input with UTC storage and semantic <time>#753
Open
alistair3149 wants to merge 10 commits intomasterfrom
Open
DateTime: user-local display/input with UTC storage and semantic <time>#753alistair3149 wants to merge 10 commits intomasterfrom
alistair3149 wants to merge 10 commits intomasterfrom
Conversation
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.
Fixes #728
Fixes #731
Summary
Three DateTime components now agree on one story: user-local wall-clock in the UI, UTC ISO on disk.
dateTimeConversion.ts(toLocalInputValue,fromLocalInputValue) usesnew Date()+.toISOString()so explicit-offset ISOs (e.g.2025-06-15T23:30:00+05:00) round-trip without silent re-encoding.DateTimeDisplayrenders valid ISOs inside a semantic<time :datetime="iso">element with the user's local wall-clock plus a visible timezone abbreviation (UTC,CEST,PST, ...). Invalid values render a<span>fallback. Validity uses the newly-exportedparseStrictDateTimefromDateTime.ts.DateTimeInputandDateTimeAttributesEditorreplace raw<input type="datetime-local">withCdxTextInput input-type="datetime-local". The Input gets acdxIconClockstart-icon (previously registered but never rendered). Twoeslint-disable vue/html-self-closingcomments retired.FIXME(#728)pins that locked the old buggy behavior are gone. Direct tests added forparseStrictDateTimesince it is now part of the public module surface.Manual Browser Check
2025-06-15 14:00saves as your local 14:00. Reload — the input should still show14:00in your host TZ.minimum/maximum, themin/maxattributes on the input reflect them in your local TZ.<time>element with adatetimeattribute equal to the stored UTC ISO.UTC,CEST,PST).<span>showing the raw string.Suggested starting URL:
http://localhost:8484/index.php/Main_Page(or any page with DateTime data).