{hero}

hoursAvailable

Since: DateTime 1.0.0

Sets which hours are selectable.
Please note - this property requires the DateTime extension for DataTables.

Description

This option allows the user to restrict which hours the user is able to select. Any values that are placed within the array are going to be selectable while all others will not.

Types

null

Description:

When this option is null all of the hours are selectable.

number[]

Description:

When this option is an array, any value for the hour that is in this array will be selectable and all others will not.

Default

  • Value: null

As default, all of the hours are selectable.

Example

Restrict the user to select either 8, 9 or 10:

$(document).ready(function () {
	new DateTime(document.getElementById('test'), {
		hoursAvailable: [8, 9, 10]
	});
});