{hero}

DateTime.use()

Since: DateTime 1.0.0

Set the formatting / parsing library to use.
Please note - this property requires the DateTime extension for DataTables.

Description

This static class method can be used to assign the date / time formatting and parsing library to be used. At this time it can be one of:

By default DateTime will attempt to detect which library you have installed, but if one is not available (e.g. it is loaded after the DateTime library), you can use this static method to assign the formatting library to use.

Type

function DateTime.use()

Description:

Change or apply the formatting / parsing date and time library that the DateTime picker will use.

Returns:

No return value.

Example

Use Moment:

DateTime.use(moment);

let el = document.getElementById('example');
let dt = new DateTime(el);