{hero}

locale

Since: DateTime 1.0.0

The locale that DateTime should use.
Please note - this property requires the DateTime extension for DataTables.

Description

This allows the locale that DateTime uses to be set - it is only used when using an external parsing and formatting library such as Moment, Luxon or DayJS. You must also load the locale you need for your formatting library of choice.

This option is related to the i18n option in the DateTime library in that it is used for internationalisation, but in this case it is used for the input value - letting the library parse and format strings in languages other than English (e.g. names of days or months).

Type

string

Description:

Set the locale that the external date parsing library (Moment, Luxon or DayJS) will use for parsing and formatting strings.

Default

  • Value: 'en'

The locale that DateTime uses by default is English.

Example

Change the locale to French:

new DateTime(document.getElementById('test'), {
	locale: 'fr'
});