maxDate
Set the maximum date that can be selected and displayed.
Please note - this property requires the DateTime extension for DataTables.
Description
This option allows a maximum selectable date to be imposed. This means that users won't be able to select dates that occur after the date set here.
Types
string
- Description:
This option can also be a string. If this is the case it must be able to be taken by the
Date
constructor as an argument to create a Date instance to represent the maximum selectable date (i.e. an ISO 8601 or RFC 2822 string).
Default
- Value:
null
As default, no maximum date is applied to DateTime instances.
Examples
Set maxDate to the end of 2029 using a RFC 2822 string:
new DateTime(document.getElementById('test'), {
maxDate: 'December 31, 2029 23:59:59'
});
Set maxDate to the end of 2029 using a Date (from ISO8601 format):
new DateTime(document.getElementById('test'), {
maxDate: new Date('2029-12-31 23:59:59')
});
Related
The following options are directly related and may also be useful in your application development.