IntlService
An abstract base class that implements the Internationalization service methods for the current locale.
Methods
dateFieldName | ||
---|---|---|
Returns a localized date field name based on specific dateFieldName options.
|
Parameters | ||
---|---|---|
options | Detailed configuration for the desired date field name. | |
localeId? | string | The optional locale id. If not specified, the |
Returns | |
---|---|
string | The localized date field name from the current locale based on the option. |
dateFormatNames | ||
---|---|---|
Returns the day names from the current locale based on the option. |
Parameters | ||
---|---|---|
options | Detailed configuration for the desired date format. | |
localeId? | string | The locale ID to use in place of the default. Optional. |
Returns | |
---|---|
any |
|
firstDay | ||
---|---|---|
Returns the first day index starting from Sunday. |
Parameters | ||
---|---|---|
localeId? | string | The locale ID. Defaults to the current locale ID. |
Returns | |
---|---|
number |
|
format | ||
---|---|---|
Formats a string with placeholders such as
|
Parameters | ||
---|---|---|
format | string | The format string. |
values | any[] | One or more values to output in the format string placeholders. |
Returns | |
---|---|
string |
|
formatDate | ||
---|---|---|
Converts a |
Parameters | ||
---|---|---|
value | Date | The date to format. |
format? | String | DateFormatOptions | The format string or options. |
localeId? | string | The locale ID to use in place of the default. Optional. |
Returns | |
---|---|
string |
|
formatNumber | ||
---|---|---|
Converts a |
Parameters | ||
---|---|---|
value | number | The number to format. |
format | string | NumberFormatOptions | The format string or options. |
localeId? | string | The locale ID to use in place of the default. Optional. |
Returns | |
---|---|
string |
|
notify |
---|
Notifies that the service was changed. |
numberSymbols | ||
---|---|---|
Returns the number symbols from the current locale based on the option. |
Parameters | ||
---|---|---|
localeId? | string | The locale ID to use in place of the default one. Optional. |
Returns | |
---|---|
any |
|
parseDate | ||
---|---|---|
Converts a string into a |
Parameters | ||
---|---|---|
value | string | The string to convert. |
format? | string | DateFormatOptions | string[] | DateFormatOptions[] | The format strings or options. |
localeId? | string | The locale ID to use in place of the default. Optional. |
Returns | |
---|---|
Date |
|
parseNumber | ||
---|---|---|
Converts a string into a |
Parameters | ||
---|---|---|
value | string | The string to convert. |
format? | string | NumberFormatOptions | The format string or options. |
localeId? | string | The locale ID to use in place of the default. Optional. |
Returns | |
---|---|
number |
|
splitDateFormat | ||
---|---|---|
Splits the date format into objects containing information about each part of the pattern. |
Parameters | ||
---|---|---|
format | string | DateFormatOptions | The format string or options. |
localeId? | string | The optional locale id. If not specified, the |
Returns | |
---|---|
The date format parts. |
toString | ||
---|---|---|
Converts an object into a string based on the specified format. |
Parameters | ||
---|---|---|
value | any | The value to format. |
format | any | The format to use. |
localeId? | string | The locale ID to use in place of the default. Optional. |
Returns | |
---|---|
string |
|
weekendRange | ||
---|---|---|
Returns the start and end index of the locale weekend starting from Sunday. |
Parameters | ||
---|---|---|
localeId? | string | The locale ID. Defaults to the current locale ID. |
Returns | |
---|---|
DayRange |
|