feat(ui): add natural language date input component#1646
Merged
Conversation
chrono-node/en parses NL text ("next tuesday 3pm", "tomorrow at noon")
into date components. Intl.DateTimeFormat resolves those components in
the user-selected IANA timezone to a UTC instant, avoiding DST edge
cases. The result serializes as DateTimeString for two-way Svelte 5
binding via $bindable().
Components: NaturalLanguageDateInput (main), TimezoneCombobox
(searchable IANA selector), parse-date.ts (parsing + bridging utility).
6 bun:test cases passing.
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.
Fuji needs a date picker that accepts natural language like "tomorrow at 3pm" or "next friday" and resolves it against a user-chosen IANA timezone. Nothing in the existing UI package handles this, and off-the-shelf NLP date pickers don't do timezone-aware resolution with DST safety.
This adds a
NaturalLanguageDateInputcomponent to@epicenter/uibuilt on chrono-node's English parser. The user types a phrase, picks a timezone from theTimezoneCombobox, and gets back aDateTimeStringin UTC. The parsing pipeline handles DST transitions correctly—winter dates use winter offsets, summer dates use summer offsets—because the offset is derived from the target date itself, not the current date.Includes a spec doc and test coverage for edge cases (DST boundaries, ambiguous times, invalid inputs).
1 commit in
packages/ui. Split from theopencode/misty-rocketbranch.