This modules defines dojo/date/locale, localization methods for Date.
See the dojo/date/locale reference documentation for more information.
gets the day of the year as represented by dateObject
Parameter | Type | Description |
---|---|---|
dateObject | Date |
Parameter | Type | Description |
---|---|---|
dateObject | Date | |
firstDayOfWeek | Number |
Returns the zone (or offset) for the given date and options. This is broken out into a separate function so that it can be overridden by timezone-aware code.
Parameter | Type | Description |
---|---|---|
dateObject | Date | the date and/or time being formatted. |
getName | boolean | Whether to return the timezone string (if true), or the offset (if false) |
options | Object |
Optional The options being used for formatting |
Parameter | Type | Description |
---|---|---|
options | Object |
Optional An object with the following properties:
|
Add a reference to a bundle containing localized custom formats to be used by date/time formatting and parsing routines.
The user may add custom localized formats where the bundle has properties following the
same naming convention used by dojo.cldr: dateFormat-xxxx
/ timeFormat-xxxx
The pattern string should match the format used by the CLDR.
See dojo/date/locale.format() for details.
The resources must be loaded by dojo.requireLocalization() prior to use
Parameter | Type | Description |
---|---|---|
packageName | String | |
bundleName | String |
Format a Date object as a String, using locale-specific settings.
Create a string from a Date object using a known localized pattern. By default, this method formats both date and time from dateObject. Formatting patterns are chosen appropriate to the locale. Different formatting lengths may be chosen, with "full" used by default. Custom patterns may be used or registered with translations using the dojo/date/locale.addCustomFormats() method. Formatting patterns are implemented using the syntax described at unicode.org
Parameter | Type | Description |
---|---|---|
dateObject | Date | the date and/or time to be formatted. If a time only is formatted, the values in the year, month, and day fields are irrelevant. The opposite is true when formatting only dates. |
options | Object |
Optional An object with the following properties:
|
Used to get localized strings from dojo.cldr for day or month names.
Parameter | Type | Description |
---|---|---|
item | String | 'months' || 'days' |
type | String | 'wide' || 'abbr' || 'narrow' (e.g. "Monday", "Mon", or "M" respectively, in English) |
context | String |
Optional 'standAlone' || 'format' (default) |
locale | String |
Optional override locale used to find the names |
Determines if the date falls on a weekend, according to local custom.
Parameter | Type | Description |
---|---|---|
dateObject | Date |
Optional
|
locale | String |
Optional
|
Convert a properly formatted string to a primitive Date object, using locale-specific settings.
Create a Date object from a string using a known localized pattern. By default, this method parses looking for both date and time in the string. Formatting patterns are chosen appropriate to the locale. Different formatting lengths may be chosen, with "full" used by default. Custom patterns may be used or registered with translations using the dojo/date/locale.addCustomFormats() method.
Formatting patterns are implemented using the syntax described at
unicode.org
When two digit years are used, a century is chosen according to a sliding
window of 80 years before and 20 years after present year, for both yy
and yyyy
patterns.
year < 100CE requires strict mode.
Parameter | Type | Description |
---|---|---|
value | String | A string representation of a date |
options | Object |
Optional An object with the following properties:
|
Builds the regular needed to parse a localized date
Parameter | Type | Description |
---|---|---|
options | Object |
Optional An object with the following properties:
|