Pickers provide a simple way to select a single value from a pre-determined set.
Date pickers use a dialog window to select a single date on mobile.
N.B. Date picker requires material.js or material.min.js.
Alternatively, options can be passed on to override some default datepicker behaviours.
Change the text of the cancel button or use cancel: '' to hide the button. Default is 'Cancel'.
Close the picker when the cancel button is clicked. Default is true. Set to false to change this behaviour.
Close the picker when a date is selected. Default is false. Set to true to change this behaviour.
Change where to insert the datepicker element by passing any valid CSS selector. By default, the picker is inserted right after the associated input element.
By default, the picker’s hidden input is inserted right after the main input element. Specify where to insert the hidden element by passing any valid CSS selector to this option.
Disable a date or a set of dates from being selectable in the picker. See below for detailed usage.
Change the first day of the week. Default is 0 which sets it to Sunday. Set it to Monday by changing the value to 1.
Set the date format. See below for a full list of available date format rules.
Optionally, set a different date format for the value to be submitted to the server. When formatSubmit is specified, a hidden input with the same name attribute as the original will be created to hold the value.
Set to true to only send the hidden value hold by the hidden input created by setting formatSubmit to the server. Setting this to true essentially nullifies the hiddenPrefix and hiddenSuffix, strips the name attribute from the source input, and then sets it as the name of the hidden input.
Add optional prefix/suffix to the name attribute of the hidden input that is created by setting formatSubmit.
Change the accessibility labels (i.e. title attributes) to several elements of the picker.
Set the maximum selectable date. See below for detailed usage.
Set the minimum selectable date. See below for detailed usage.
Change labels of months.
Change abbreviations of months.
Change the text of the OK button or set it to '' to hide the button. Default is 'OK'.
onClose, onOpen, onRender, onSet, onStart, onStop
Fire events as the user interacts with the picker. Within scope of these events, this refers to the picker.
Default is false. Set it to true to display a dropdown menu to pick the month.
Default is false. Set it to true to display a dropdown menu to pick the year or use an even integer to specify the number of years to be shown in the dropdown menu (half after and the other half before the year in focus).
Change the text of the today button or pass an empty value to hide the button: today: ''. Default is 'Today'.
Change labels of weekdays.
Change abbreviations of weekdays.
Maximum and minimum selectable dates can be set on the picker.
Disable a specific or arbitrary set of dates selectable on the picker.
The values for from and to can be:
Array formatted as [YEAR,MONTH,DATE]
true to set it as “today”
The values can also be integers representing dates relative to the other:
The following rules can be used to format any date: