firstDay
Change which day of the week is first on the calendar.
Please note - this property requires the DateTime extension for DataTables.
Description
This option allows for the "first" day to be changed to any of the days of the week as desired.
As of DateTime 2, this parameter supports auto detection through the
browser's native Intl.Locale
API.
Please note that this API isn't supported in Firefox at the time of
writing. If the auto detection fails, 1 (Monday) will be used.
Type
number | null
This value represents which day of the week should be in the first
column of datetime. If null is given autodetection will be
attempted, and if that fails, 1 (Monday) will be used.
The days are 0 indexed starting from Sunday:
- 0 - Sunday
- 1 - Monday
- 2 - Tuesday
- 3 - Wednesday
- 4 - Thursday
- 5 - Friday
- 6 - Saturday
Default
- Value:
null
The default value of null will result in auto detection being used.
Example
Change first day to Saturday:
new DateTime(document.getElementById('test'), {
firstDay: 6
});