Admin Page Framework - Field Type Pack Documentation
  • Package
  • Class

Packages

  • AdminPageFrameworkFieldTypePack
    • CustomFieldType

Classes

  • AutoCompleteCustomFieldType
  • DateCustomFieldType
  • DateRangeCustomFieldType
  • DateTimeCustomFieldType
  • DateTimeRangeCustomFieldType
  • DialCustomFieldType
  • EDDSoftwareLicensingCustomFieldType
  • FontCustomFieldType
  • GeometryCustomFieldType
  • GridCustomFieldType
  • ImageCheckboxCustomFieldType
  • ImageRadioCustomFieldType
  • LinkCustomFieldType
  • RevealerCustomFieldType
  • TimeCustomFieldType
  • TimeRangeCustomFieldType

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 the datetimepicker() 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

Methods summary

protected
# setUp( )

Loads the field type necessary components.

protected
# getEnqueuingScripts( )

Returns an array holding the urls of enqueuing scripts.

protected
# getEnqueuingStyles( )

Returns an array holding the urls of enqueuing styles.

protected
# getScripts( )

Returns the field type specific JavaScript script.

protected
# getIEStyles( )

Returns IE specific CSS rules.

protected
# getStyles( )

Returns the field type specific CSS rules.

protected
# getField( mixed $aField )

Returns the output of this field type.

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.
Admin Page Framework - Field Type Pack Documentation generated by ApiGen 2.8.0