{hero}

max()

Since: DateTime 1.0.0

Set the max date for the DateTime instance.
Please note - this property requires the DateTime extension for DataTables.

Description

This method sets the max date for the DateTime instance. It takes either a Date instance directly or a string representing a date that is then parsed into a date.

Types

max(date)

Set the max date for the DateTime instance.

Parameters:

Returns:

DateTimeSelf for chaining.

max(date)

Set the max date for the DateTime instance.

Parameters:

Returns:

DateTimeSelf for chaining.

Example

Set the max date for DateTime:

var dt = new DateTime(document.getElementById('example'));
dt.max('2025-12-31');