Options

The DateTime component can be initialised and used on input elements separately from any DataTables usage if you wish to use it else where on your site. It provides a range of options that can be used to configure the control that it creates, from changing the date format, to including time components. The list below shows all available options - click through to each for full details.

Options for DateTime are set using the object given as the second parameter to the constructor:

new DataTable.DateTime('#myInput', {
    // ... options
});
Name Summary Library Group

alwaysVisible

Makes the date picker always display.

buttons

Container for navigation buttons

buttons.clear

Enable button to clear the value

buttons.selected

Enable button move the current value into view

buttons.today

Enable button move "today" into view

disableDays

Specify days that cannot be selected.

firstDay

Change which day of the week is first on the calendar.

format

The format of the date data.

hoursAvailable

Sets which hours are selectable.

i18n

DateTime language options.

i18n.amPm

The strings appended to hours to distinguish between am and pm.

i18n.clear

Clear button text value

i18n.hours

Label for the hours selection.

i18n.minutes

Label for the minutes selection.

i18n.months

Text used to indicate the months available for selection.

i18n.next

String to use in the next button.

i18n.previous

String to use in the previous button.

i18n.seconds

Label for the seconds selection.

i18n.selected

Selected button text value

i18n.today

Today button text value

i18n.unknown

String to use if a value is unknown.

i18n.weekdays

Text used to indicate the days of the week.

locale

The locale that DateTime should use.

maxDate

Set the maximum date that can be selected and displayed.

minDate

Set the minimum date that can be selected and displayed.

minutesAvailable

Sets which minutes are selectable.

onChange

Function that is called whenever the value selected for DateTime changes.

secondsAvailable

Sets which seconds are selectable.

showWeekNumber

Whether the week number should be shown.

yearRange

The range of years provided for selection.