dojo/date/locale¶
Contents
dojo/date/locale offers a library of localization methods to format and parse dates and times.
Introduction¶
When you want to present dates or times to the user, JavaScript only knows how to handle a single locale and language, and the actual format is implementation-dependent, and your web application has no control over these choices.
Dojo comes with a powerful library to format and parse dates and times using local language and conventions, from your choice of hundreds of locales, or as you would like using custom date/time patterns.
Features¶
dojo/date/locale
offers the following methods:
dojo/date/locale::addCustomFormats()
Adds a reference to a bundle containing localized custom formats to be used by date/time formatting and parsing routines.
-
Formats a Date object as a String, using locale-specific settings or custom patterns.
-
Used to get localized strings from
dojo/cldr
for day or month names. -
Determines if the date falls on a weekend, according to local custom.
-
Converts a properly formatted string to a primitive Date object, using locale-specific settings.
-
Builds the regular needed to parse a localized date.
See also¶
- Cultural conventions: Date, Number and Currency
- dojo/date - Basic date handling functions
- dojo/date/stamp - handling of date representations using a subset of the ISO-8601 standard, typically for unambiguous, machine-readable formatting and parsing of dates.