File tree Expand file tree Collapse file tree 3 files changed +54
-2
lines changed Expand file tree Collapse file tree 3 files changed +54
-2
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,55 @@ The names.
8686
8787If the type is ` "dayPeriods" ` or ` "eras" ` , an object is returned. For the other types, the result is ` Array ` .
8888
89+ ### dateFieldName
90+
91+ Returns a localized date field name based on a specific format specifier.
92+
93+ #### dateFieldName Parameters
94+
95+ ##### options ` Object `
96+
97+ The options that determine the returned date field name.
98+
99+ ##### options.type ` String `
100+
101+ The type of the date field name.
102+
103+ The supported values are:
104+ * ` "era" `
105+ * ` "year" `
106+ * ` "quarter" `
107+ * ` "month" `
108+ * ` "week" `
109+ * ` "day" `
110+ * ` "weekday" `
111+ * ` "dayperiod" `
112+ * ` "hour" `
113+ * ` "minute" `
114+ * ` "second" `
115+ * ` "zone" `
116+
117+ ##### options.nameType ` String `
118+
119+ The format name type.
120+
121+ The supported values are:
122+ * ` "wide" `
123+ * ` "narrow" `
124+ * ` "short" `
125+
126+ ##### locale ` String `
127+
128+ The locale id.
129+
130+ #### dateFieldName Return Value
131+
132+ ##### Returns ` String `
133+
134+ The date field name.
135+
136+ If an information for the specified date field type is missing, a ` undefined ` is returned.
137+
89138### numberSymbols
90139
91140Returns the number symbols from the specified locale.
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ The following table provides the data formats that are required for number and d
2626| Basic dates | ` cldr/main/locale/ca-gregorian.json ` |
2727| Localized timezone | ` cldr/main/locale/timeZoneNames.json ` |
2828| Numeric week day formatting | ` cldr/supplemental/weekData.json ` |
29+ | Localized date field names | ` cldr/supplemental/dateFields.json ` |
2930
3031## Getting CLDR Data
3132
@@ -43,6 +44,7 @@ const numbers = require("cldr-data/main/bg/numbers.json");
4344const timeZoneNames = require("cldr-data/main/bg/timeZoneNames.json");
4445const calendar = require("cldr-data/main/bg/ca-gregorian.json");
4546const currencies = require("cldr-data/main/bg/currencies.json");
47+ const currencies = require("cldr-data/main/bg/dateFields.json");
4648const weekData = require("cldr-data/supplemental/weekData.json");
4749const currencyData = require("cldr-data/supplemental/currencyData.json");
4850
5355 numbers,
5456 currencies,
5557 calendar,
58+ dateFields,
5659 timeZoneNames
5760);
5861
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ export interface DateFieldNameOptions {
6262/**
6363 * Returns a localized date field name based on a specific format specifier.
6464 *
65- * @param formatSpecifier The dateFieldName options.
65+ * @param options The dateFieldName options.
6666 * @param locale The optional locale id. If not specified, the `"en"` locale id is used.
6767 * @returns The localized date field name determined by the dateFieldName options.
6868 *
@@ -74,7 +74,7 @@ export interface DateFieldNameOptions {
7474 * dateFieldName({ type: 'month', nameType: 'wide' }); //returns 'month';
7575 * ```
7676 */
77- export function dateFieldName ( formatSpecifier : DateFieldNameOptions , locale ?: string ) : string ;
77+ export function dateFieldName ( options : DateFieldNameOptions , locale ?: string ) : string ;
7878
7979/**
8080 * Returns the first day index starting from Sunday based on the specified locale.
You can’t perform that action at this time.
0 commit comments