Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (20 sloc) 896 Bytes

Time Dropdown Field

Allows to select certain time intervals from a dropdown as an alternative to direct input into a TimeField. Adheres to user preferences in time formats set through the TimeField API, which by extension supports user preferences through i18n::get_time_format().


As an isolated field:

$field = TimeDropdownField::create('MyTime', 'My Time Field');

As part of a DatetimeField (requires SilverStripe 3.1):

$datetimeField = DatetimeField::create('MyDateTime', My Date and Time Field')


  • interval: Spacing in minutes between options (Default: 60)

Note: Since the field extends TimeField, most configuration happens in there.


  • Ingo Schommer (@chillu)

Thanks to Air New Zealand for sponsoring and contributing to this module!