Repository navigation
feat(forms): time segments for DateInput and DatePicker - #617
Merged
josemarluedke merged 2 commits intoOct 14, 2026
Merged
Conversation
✅ Deploy Preview for frontile-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Owner
`@granularity` ('day' by default, 'hour' or 'minute') adds hour and minute
segments after the date ones, ordered and separated by the locale like the
date segments. A 12-hour clock adds an AM/PM segment, typed by its first
letter and stepped with the arrows; `@hourCycle` forces 12 or 24.
The value stays a Date, now carrying the time, and the field submits and
accepts the local `yyyy-MM-ddTHH:mm` that datetime-local uses, so it
round-trips through form data with no time-zone conversion. Picking a day
in the calendar keeps the time the field shows (each end of a range its
own) or starts at midnight. The button trigger adds `timeStyle: 'short'`
by default. Paste reads ISO date-times, AM/PM words, and a 24-hour time
into a 12-hour field; fillDate and fillDateRange type the time too.
Closes josemarluedke#616
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R3mA4zgRstPD9uLyJut5Nn
Intl joins them with one in many locales (01/20/2026, 09:05 PM). The literal between the last date segment and the first time segment now drops it, keeping whatever else the locale put there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WkpExUYSun56aYFoHVcjJC
MichalBryxi
force-pushed
the
feat/date-time-granularity
branch
from
October 14, 2026 04:24
2df6515 to
92ca635
Compare
Contributor
Author
|
Done in 92ca635: the literal between the date and the time drops the comma ( |
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.

Summary
Adds time entry to
DateInputandDatePicker, as proposed in #616.@granularity:'day'(the default, unchanged),'hour'or'minute'. The time segments come fromIntl.DateTimeFormat.formatToParts, like the date ones, so their order and separators follow the locale.@hourCycle:12 | 24, defaulting to the locale. The hour segment's bounds follow the cycleIntlresolves (h11/h12/h23/h24). A 12-hour cycle adds an AM/PM segment (dayPeriod) with the locale's labels. It's typed by its first letter, stepped with the arrows, and announced by name througharia-valuetext.Date, now with the time. The hidden input submits the localyyyy-MM-ddTHH:mm(thedatetime-localshape), and@value/parseDateaccept it, so a value round-trips through form data with no time-zone conversion.toWiretakes the granularity.{ dateStyle: 'medium', timeStyle: 'short' }when there's a time.Tor a space), AM/PM read from the text (PM,a.m.), and a 24-hour time pasted into a 12-hour field lands on the right side of noon. An ISO date alone still fills the date and leaves the time.fillDate/fillDateRangeacceptyyyy-MM-ddTHH:mmand type the time. The hour goes in on the field's own clock, read from the spinbutton bounds, and AM/PM is set by stepping, so the helpers don't depend on the locale's labels.The exported segment helpers keep their signatures:
buildPartsandemptySegmentgain optional parameters, andseedFromwas internal.Closes #616.
Out of scope
Seconds, and time zones: the value is a local wall-clock time, like
datetime-local's.Test plan
date-input-time-test.ts): segment order per locale, hour bounds per cycle,@hourCycleoverrides, typing, AM/PM by letter and by arrow, round-trips including noon and midnight, paste,parseDate/toWire.date-time-test.gts):DateInputandDatePickerwith a time, AM/PM typing, a 24-hour locale,Formround-trips for a single field and a range, calendar picks keeping the typed time or starting at midnight, and the button trigger's default format.eslint,prettier,ember-template-lintandember-tscon the package pass.lint:anatomyreports two orphan parts insegment-group.gts, whichmainreports too.🤖 Generated with Claude Code
https://claude.ai/code/session_01R3mA4zgRstPD9uLyJut5Nn