{hero}

yearRange

Since: DateTime 1.0.0

The range of years provided for selection.
Please note - this property requires the DateTime extension for DataTables.

Description

This option is used if either maxDate or minDate are not in use to determine how many years to show to the user for selection.

To determine the max year that can be selected this value is added to the current year. Similarly for min year this value is subtracted. If maxDate or minDate are declared then it will not be used to determine the range in the relative directions.

Type

number

Description:

The number of years after and before the current year that should be available to be selected.

Default

  • Value: 25

The default range of years that can be selected is plus or minus 25 years.

Example

Set the year range to 50:

$(document).ready(function () {
	new DateTime(document.getElementById('test'), {
		yearRange: 50
	});
});

Related

The following options are directly related and may also be useful in your application development.