Usage
When using DateTime for your own input elements, initialisation and configuration is performed through the DataTable.DateTime object. For cases when the picker is being used by other extensions, they will provide an option to allow customisation of DateTime (e.g. Editor's datetime input type provides a config option), and will initialise the control automatically.
Simple initialisation
In its most simple case for your own input elements, initialise DateTime by passing it the element that it should attach the picker to - e.g.
<input id="myInput" value="2027-01-30">
new DataTable.DateTime('#myInput');
When you then click on the input element, the picker will show and you can use your mouse to select a date.
Options
For more complex cases, the constructor accepts a second argument, which are the configuration options for the control.
new DataTable.DateTime(document.getElementById('test'), {
format: 'D MMM YYYY HH:mm'
});
This example makes use of format to specify a date / time format for the display of the value in the input box. See the formatters documentation for further information about the formats that can be used with Luxon and Moment.
Reference
For a complete list of the options that DateTime supports, please refer to the DateTime initialisation options reference. The API reference is also available, and the DateTime examples demonstrate the options and methods available.