Arguments
Name | Type | Default | Description |
---|
id | string | | A unique ID. This ID will be used to get the value |
type | string | date | Type of the field |
title | string | | Title of the field |
default | array | | Default value from database, if option doesn’t exist |
subtitle | string | | Subtitle to display below the title |
desc | string | | Description to display after the field |
help | string | | Extra CSS classes (space separated) to append to the field |
before | string | | Content to display before the field |
after | string | | Content to display after the field |
dependency | array | | Define field visibility depending on other field values |
attributes | array | | Extra HTML attributes to append to the field |
sanitize | string | | Callback function for sanitizing value |
validate | string | | Callback funciton for validating value |
EXTRAS | | | |
settings | array | | An associative array containing arguments for the setting |
Settings Arguments
Name | Type | Default | Description |
---|
dateFormat | string | mm/dd/yy | Format for parsed and displayed dates |
changeMonth | bool | false | Flag to display month as dropdown instead of text |
changeYear | bool | false | Flag to display year as dropdown instead of text |
showWeek | bool | false | When true, a column is added to show the week of the year |
showButtonPanel | bool | false | Flag to display a button pane underneath the calendar |
weekHeader | string | Wk | Text to display for the week of the year column heading |
monthNamesShort | array | | List of abbreviated month names, as used in the month header on each datepicker and as requested via the dateFormat option |
dayNamesMin | array | | List of minimised day names, starting from Sunday, for use as column headers within the datepicker |
Get more information for jquery-ui-datepicker arguments.
Simple Date Field Example
array(
'id' => 'test-date',
'type' => 'date',
'title' => 'Example Date',
),
Advanced Date Field Example
array(
'id' => 'test-date',
'type' => 'date',
'title' => 'Example Date',
'settings' => array(
'dateFormat' => 'mm/dd/yy',
'changeMonth' => true,
'changeYear' => true,
'showWeek' => true,
'showButtonPanel' => true,
'weekHeader' => 'Week',
'monthNamesShort' => array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ),
'dayNamesMin' => array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ),
),
),
Was this article helpful to you?
Yes
No