New to Kendo UI for AngularStart a free 30-day trial

IntlService

Represents the abstract base class for the Kendo UI for Angular Internationalization service. Provides methods for formatting and parsing dates, numbers, and strings according to the current locale.

Extend this class to implement custom internationalization logic or use the default CLDR-based implementation.

Methods

dateFieldName

Returns a localized date field name based on specific dateFieldName options.

ts
dateFieldName({ type: 'day' });                      //returns 'day';
dateFieldName({ type: 'day', nameType: 'wide' });    //returns 'day';
dateFieldName({ type: 'month', nameType: 'short' }); //returns 'mo.';
dateFieldName({ type: 'month', nameType: 'wide' });  //returns 'month';
Parameters

options

DateFieldNameOptions

Detailed configuration for the desired date field name.

localeId?

string

The locale ID to use (optional). If not specified, the "en" locale ID is used.

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

DateFormatNameOptions

Detailed configuration for the desired date format.

localeId?

string

The locale ID to use in place of the default (optional).

Returns

any

The day names from the current locale based on the option.

firstDay

Returns the first day index starting from Sunday.

Parameters

localeId?

string

The locale ID (optional). Defaults to the current locale ID.

Returns

number

The index of the first day of the week (0 == Sunday).

format

Formats a string with placeholders such as Total amount {0:c}.

Parameters

format

string

The format string.

values

any[]

One or more values to output in the format string placeholders.

Returns

string

The formatted string.

formatDate

Converts a Date object into a string based on the specified format (see example). If no format is provided, the default short date format is used.

Parameters

value

Date

The date to format.

format?

string | DateFormatOptions

The format string or options (optional).

localeId?

string

The locale ID to use in place of the default (optional).

Returns

string

The formatted date as a string.

formatNumber

Converts a Number into a string based on the specified format.

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

The formatted number as a string.

notify

Specifies 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

The number symbols from the current locale.

parseDate

Converts a string into a Date object based on the specified format.

Parameters

value

string

The string to convert.

format?

string | string[] | DateFormatOptions | DateFormatOptions[]

The format strings or options (optional).

localeId?

string

The locale ID to use in place of the default (optional).

Returns

Date

The parsed date.

parseNumber

Converts a string into a Number.

Parameters

value

string

The string to convert.

format?

string | NumberFormatOptions

The format string or options (optional).

localeId?

string

The locale ID to use in place of the default (optional).

Returns

number

The parsed 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 locale ID to use (optional). If not specified, the "en" locale ID is used.

Returns

DateFormatPart[]

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

The formatted object as a string.

weekendRange

Returns the start and end index of the locale weekend starting from Sunday.

Parameters

localeId?

string

The locale ID (optional). Defaults to the current locale ID.

Returns

DayRange

The start and end index of the locale weekend (0 == Sunday).

In this article
Methods
Not finding the help you need?
Contact Support