API

The DateTime component provides a comprehensive API that can be used to get and set values in controls that use the library, and also to provide manipulation options. Please see the list below for the full set of API methods that are available, and click through to get details of each one.

The DateTime API can be accessed through the object that is returned from its constructor:

let dt = new DataTable.DateTime('#myInput', {
    // ... options
});
Name Summary Library Group

DateTime.use()

Set the formatting / parsing library to use.

destroy()

Destroy a DateTime control.

display()

Get / set the month and year for the current display.

errorMsg()

Either sets the error message or removes it

hide()

Hides the DateTime instance

max()

Set the max date for the DateTime instance

min()

Set the min date for the DateTime instance.

owns()

Check if an element belongs to this control.

val()

Get / set the value of the DateTime instance.

valFormat()

Get / set a formatted value for the instance.