Skip to content

Files

Latest commit

 

History

History
31 lines (20 loc) · 1.27 KB

field-type-datetime.md

File metadata and controls

31 lines (20 loc) · 1.27 KB

Field Type - Datetime

Usage

The datetime field type should be a DATETIME type in your database.

'start_time' => array(
	'type' => 'datetime',
	'title' => 'Start Time',
	'date_format' => 'yy-mm-dd', //optional, will default to this value
	'time_format' => 'HH:mm', 	 //optional, will default to this value
)

In the edit form, an admin user will be presented with a jQuery datetimepicker.

The date_format option lets you define how the date is displayed. This uses the formatting options from jQuery Datepicker formatDate.

The time_format option lets you define how the time is displayed. This uses the formatting options from jQuery timepicker.

Filter

The datetime field filter comes with a start and end datetime. This allows you to narrow down the result set to a range, set only a minimum datetime, or set only a maximum datetime.