TimePicker
TimePicker is a composite field comprising several HTML fields strung together to collect one piece of information. TimePicker collects a time of day in a locale-appropriate format, automatically choosing 24/12-hour display, and appropriate AM/PM symbols. This format is designed to allow the user to pick any time. If you want to restrict the times the user may select to a certain subset of the times available during the day, we recommend you consider a regular select field with each available time listed.
The default datatype for TimePicker is time.
The following special attributes are available for TimePicker:
-
twentyfourhour
Optional. Display time in 24 hour format? This attribute may be true, false, or blank. If blank, TerraForm will automatically choose 12 hour or 24 hour based on the locale. -
hoursPrompt, minutesPrompt, secondsPrompt
Optional. Prompt for each column of numbers. Default to "H", "M", and "S" respectively. -
minutes
Optional. Display minutes selector? True or false, defaults to true. -
seconds
Optional. Display seconds selector? True or false, defaults to false. -
minuteinterval
Optional. Integer interval between available minutes within the hour. For example "15" would allow you to choose 0, 15, 30, or 45. Defaults to 1. -
secondinterval
Optional. Integer interval between available seconds within the minute. Defaults to 1.
Other non-TerraField attributes will be passed through to the underlying select box tags (<select>).
When this composite field is submitted with valid data, several fields will become available. Depending on the format of the picker, these may not all become available (e.g. [name]_seconds won't be available if the seconds attribute is set to false). They are (where [name] represents the name of the field):
-
[name]
The full time chosen - an internationalised ODBC date/time object. -
[name]_hours
The hours component chosen (not necessarily the hour of the day, if a 12-hour picker is used. -
[name]_minutes
The minutes component. -
[name]_seconds
The seconds component. -
[name]_ampm
The AM/PM indicator. Note this is locale-specific, e.g. PM would appear as오후for the localeKorean.
Examples
Fields marked with * are required.
