Class DateTimeCustomFieldType
Defines the date-time field type.
Field Type Specific Arguments
date_format
- (string) date format default:yy/mm/dd
.time_format
- (string) date format default:H:mm
.options
- (array) the option values passed to thedatetimepicker()
jQuery plugin method.
Example
array( // Single date-time picker 'field_id' => 'date_time', 'type' => 'date_time', 'title' => __( 'Date & Time', 'admin-page-framework-field-type-pack' ), 'date_format' => 'yy-mm-dd', // yy/mm/dd is the default format. 'time_format' => 'H:mm', // H:mm is the default format. ), array( // Multiple date-time pickers 'field_id' => 'dates_time_multiple', 'type' => 'date_time', 'title' => __( 'Multiple Date and Time', 'admin-page-framework-field-type-pack' ), 'label' => __( 'Default', 'admin-page-framework-field-type-pack' ), 'time_format' => 'H:mm', 'date_format' => 'yy-mm-dd', // yy/mm/dd is the default format. 'delimiter' => '<br />', 'attributes' => array( 'size' => 24, ), array( 'label' => __( 'AM PM', 'admin-page-framework-field-type-pack' ), 'time_format' => 'hh:mm tt', ), array( 'label' => __( 'Time Zone', 'admin-page-framework-field-type-pack' ), 'time_format' => 'hh:mm tt z', ), array( 'label' => __( 'Number Of Months', 'admin-page-framework-field-type-pack' ), 'options' => array( 'numberOfMonths' => 3, ), ), array( 'label' => __( 'Min & Max Dates', 'admin-page-framework-field-type-pack' ), 'options' => array( 'numberOfMonths' => 2, 'minDate' => 0, 'maxDate' => 30, ), ), ), array( // Repeatable date time picker 'field_id' => 'date_time_repeatable', 'type' => 'date_time', 'title' => __( 'Repeatable Date & Time Fields', 'admin-page-framework-field-type-pack' ), 'repeatable' => true, 'options' => array( 'timeFormat' => 'HH:mm:ss', 'stepHour' => 2, 'stepMinute' => 10, 'stepSecond' => 10, ), ), array( // Sortable date_time picker fields 'field_id' => 'date_time_sortable', 'type' => 'date_time', 'title' => __( 'Sortable', 'admin-page-framework-field-type-pack' ), 'sortable' => true, 'attributes' => array( 'size' => 30, ), 'options' => array( 'timeFormat' => 'HH:mm z', 'timezoneList' => array( array( 'value' => -300, 'label' => __( 'Eastern', 'admin-page-framework-field-type-pack' ), ), array( 'value' => -360, 'label' => __( 'Central', 'admin-page-framework-field-type-pack' ), ), array( 'value' => -420, 'label' => __( 'Mountain', 'admin-page-framework-field-type-pack' ), ), array( 'value' => -480, 'label' => __( 'Pacific', 'admin-page-framework-field-type-pack' ), ), ), ), array(), // the second item array(), // the third item ),
Package: AdminPageFrameworkFieldTypePack\CustomFieldType
Since: 1.0.0
Located at custom-field-types/date-time-custom-field-types/DateTimeCustomFieldType.php
Since: 1.0.0
Located at custom-field-types/date-time-custom-field-types/DateTimeCustomFieldType.php
Methods summary
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
#
_getDateTimePickerEnablerScript( mixed $sInputID, mixed $sDateFormat, mixed $sTimeFormat, mixed $asOptions )
A helper function for the above getDateField() method. |
Magic methods summary
Properties summary
public
array
|
$aFieldTypeSlugs |
#
Defines the field type slugs used for this field type. |
protected
array
|
$aDefaultKeys |
#
Defines the default key-values of this field type. Remark
$_aDefaultKeys holds shared default key-values defined in the base class.
|