Option |
Type |
Default |
Description |
presetRanges |
array |
see source |
Array of objects. Each object describes an item in the
presets menu and must have the following properties:
Property |
Type |
Description |
text |
string |
the label of the menu option. |
dateStart |
function returning a moment |
the start of the preset date range |
dateEnd |
function returning a moment |
the end of the preset date range |
|
initialText |
string |
'Select date range...' |
Placeholder text - shown when no date range is
selected. |
icon |
string |
'ui-icon-triangle-1-s' |
CSS class of the icon shown inside the trigger button. |
applyButtonText |
string |
'Apply' |
Label of the Apply button. If the label is empty string the button will not be rendered. |
clearButtonText |
string |
'Clear' |
Label of the Clear button. If the label is empty string the button will not be rendered. |
cancelButtonText |
string |
'Cancel' |
Label of the Cancel button. If the label is empty string the button will not be rendered. |
rangeSplitter |
string |
' - ' |
String used between the start and end dates. |
dateFormat |
string |
'M d, yy' |
Displayed date format. See available
formats.
|
altFormat |
string |
'yy-mm-dd' |
Submitted date format - used inside JSON {
"start": "...", "end": "..." } .
|
verticalOffset |
int |
0 |
Vertical offset of the dropdown (measured from just
below/above the trigger button). Useful for custom borders. |
mirrorOnCollision |
boolean |
true |
Use a mirrored layout (calendar followed by presets menu) when there is
not enough space on the right and the dropdown opens to the left. |
autoFitCalendars |
boolean |
true |
Override the numberOfMonths from datepickerOptions
in order to fit widget width inside the viewport.
|
applyOnMenuSelect |
boolean |
true |
Use auto-apply when a preset date range is selected from the menu. |
datepickerOptions |
object |
see source |
Object containing the options used to initialize the
jQuery UI datepicker widget. See all
available options.
|
open |
function |
null |
Callback that executes when the dropdown opens. |
close |
function |
null |
Callback that executes when the dropdown closes. |
change |
function |
null |
Callback that executes when the date range changes. |
clear |
function |
null |
Callback that executes when the "Clear" button is used. |
cancel |
function |
null |
Callback that executes when the "Cancel" button is used. |
onOpen |
function |
null |
deprecated
Callback that executes when the dropdown opens. |
onClose |
function |
null |
deprecated
Callback that executes when the dropdown closes. |
onChange |
function |
null |
deprecated
Callback that executes when the date range changes. |
onClear |
function |
null |
deprecated
Callback that executes when the clear button is used. |