constructor new Control.DatePicker
new Control.DatePicker(element[, options])
-
element(String|Element) – A<input type="text">element (or DOM ID). -
options(Hash) – Additional options for the control.
Create a new date picker from the given <input type="text">
element.
Additional options:
- icon: The URL of the icon to display on the control
- monthCount: The number of calendar months to display at one time
- layout: Layout mode for multiple calendars: 'horizontal' (default) or 'vertical'
- range: Use date range selection instead of a single date.
Requires multiple
<input>elements (see rangeEnd below). - rangeEnd: The element for storing a date range's end date in. If a rangeEnd
element is not specified, it will automatically look for one as a next
sibling of
element. - minDate: The minimum date that is allowed to be selected
- maxDate: The maximum date that is allowed to be selected
- locale: Set the internationalization locale code
- manual: Allow manual date entry by typing (default true)
- epoch: The date posted to the server will be as a unix timestamp representing the milliseconds since 1-1-1970
- timePicker: Display a time picker (default false)
- use24hrs: Show 24 hours in the time picker instead of AM/PM (default false)
- onSelect: Callback function when a date/time is selected. A Date object is passed as the parameter.
- onHover: Callback function when the active date changes via keyboard navigation. A Date object is passed as the parameter.