FlexTimeField selects a local time of day. It does not store a date or timezone offset. Use FlexDurationField for elapsed hours beyond 24.
Basic clock
The default saved format is H:i. The menu opens from the whole readonly input, with standard FLEX dropdown motion.
12-hour display
The display becomes 02:30 PM; storage remains 14:30. forceLeadingZeros(false) uses 2:30 PM. An explicit displayFormat() takes priority over the automatic format.
Interval steps
Minute/second steps must be positive divisors of 60: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 or 60. The minute default is 15. Steps control menu options; an existing precise time is retained until changed. They are not an additional server-side divisibility rule.
Restrict hours
The bounds are inclusive and refer to one day. Min must not exceed max. 23:00 to 02:00 is not a same-day clock range; use a date/time range for an overnight period.
Only specific times
The list is sorted and deduplicated. Values use HH:mm or HH:mm:ss, regardless of display format. Up to 1,440 entries are accepted. Both typed input and form submission enforce membership.
Without an explicit defaultTime(), the first allowed time becomes the default candidate. An explicit default outside the list is invalid configuration. Empty choices show an empty state, and no time can pass validation.
Seconds
Seconds have a separate selector. The saved format becomes H:i:s. To offer exact second-bearing slots:
Do not configure second-bearing allowed values with a format that discards seconds.
Enter a complete clock such as 14:30, or open the menu with ArrowDown/F4. In 12-hour mode include AM/PM. Invalid text and out-of-range times show feedback and fail form validation. This clock input validates the complete text; guided date segments belong to date fields.
Clearable and readonly
Clock clearing is off by default. Readonly/disabled fields cannot change from typing or menus. An optional empty clock saves null.
Time range
Both endpoints use the same bounds, steps, format and allowed-time list. End may equal start but cannot precede it. Clearing one endpoint leaves an incomplete range; complete both or clear both before submission.
Compact API
This class uses the same current time input and dropdown as FlexTimeField; it does not introduce another storage format.
Hidden seconds remain preserved while the displayed value is untouched. A newly selected menu value uses the current seconds unless you explicitly choose another second value.
Timezone label
Changing the label does not convert stored hours. Resolve local times to instants only after combining a date and timezone in your application.
Keyboard
Enter/Space open a readonly clock. ArrowDown and F4 open either mode. Inside the list, ArrowUp/ArrowDown move between enabled options, Home/End move to the first/last, and Enter selects. Escape closes the list. Focus returns to the trigger after keyboard selection or dismissal. Last modified on October 16, 2026