Get or set jQuery UI datepicker (and timepicker) options
https://api.jqueryui.com/datepicker/
Can also be used with several timepicker options: https://trentrichardson.com/examples/timepicker/#tp-options
Example
// set custom options
$inputfield->datepickerOptions([ 'changeMonth' => false, 'changeYear' => false ]);
// set the defaults for all datepicker fields/inputs to start from
$config->js('InputfieldDatetimeDatepickerDefaults', [ 'showButtonPanel' => true ]);
// override settings for all datetime fields/inputs
$config->js('InputfieldDatetimeDatepickerOptions', [ 'showAnim' => 'drop' ]);
// override settings for all datetime fields/inputs (from JS)
$.extend(ProcessWire.config.InputfieldDatetimeDatepickerOptions, { 'showAnim': 'drop' });
Usage
// basic usage
$array = $inputfieldDatetime->datepickerOptions();
// usage with all arguments
$array = $inputfieldDatetime->datepickerOptions(array $options = []);
Arguments
Name | Type(s) | Description |
---|---|---|
options (optional) | array |
Return value
array
InputfieldDatetime methods and properties
API reference based on ProcessWire core version 3.0.244