Skip to content

feat(ui): add natural language date input component#1646

Merged
braden-w merged 1 commit intomainfrom
ui-components
Apr 11, 2026
Merged

feat(ui): add natural language date input component#1646
braden-w merged 1 commit intomainfrom
ui-components

Conversation

@braden-w
Copy link
Copy Markdown
Member

@braden-w braden-w commented Apr 11, 2026

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 NaturalLanguageDateInput component to @epicenter/ui built on chrono-node's English parser. The user types a phrase, picks a timezone from the TimezoneCombobox, and gets back a DateTimeString in 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.

import { NaturalLanguageDateInput, TimezoneCombobox } from '@epicenter/ui/natural-language-date-input';
User types: "next friday 2:30pm"
Timezone:   America/New_York (UTC-4 in summer, UTC-5 in winter)
Output:     2026-04-17T18:30:00.000Z  (correctly resolved for April = EDT)

Includes a spec doc and test coverage for edge cases (DST boundaries, ambiguous times, invalid inputs).

1 commit in packages/ui. Split from the opencode/misty-rocket branch.

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.
@braden-w braden-w merged commit 10a2142 into main Apr 11, 2026
1 of 9 checks passed
@braden-w braden-w deleted the ui-components branch April 11, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant