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

Represents the Internationalization service implemented using the CLDR Database via the @progress/kendo-intl package. Provides locale-aware formatting and parsing for dates, numbers, and strings.

Definition

Package:@progress/kendo-angular-intl

Syntax:

ts
import { CldrIntlService } from '@progress/kendo-angular-intl';
const intl = new CldrIntlService('en-US');
intl.formatDate(new Date(), { date: 'short' });

Methods

Returns the date names from the current locale based on the option.

The available type values are:

  • era
  • year
  • quarter
  • month
  • week
  • day
  • dayperiod
  • hour
  • minute
  • second
  • zone

The available nameType values are:

  • wide
  • narrow
  • short
Parameters:optionsDateFieldNameOptions

Detailed configuration for the desired date field name.

localeId?string

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

Returns:

string

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

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

The available type values are:

  • day
  • dayperiod
  • months
  • quarters
  • eras
Parameters:optionsDateFormatNameOptions

Detailed configuration for the desired date format.

localeId?string

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

Returns:

any

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

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).

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

Parameters:formatstring

The format string.

valuesany[]

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

Returns:

string

The formatted string.

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

Parameters:valueDate

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 one (optional).

Returns:

string

The formatted date as a string.

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

Parameters:valuenumber

The number to format.

formatstring | NumberFormatOptions

The format string or options.

localeId?string

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

Returns:

string

The formatted number as a string.

Specifies that the service was changed.

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.

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

Parameters:valuestring

The string to convert.

format?string | DateFormatOptions | string[] | DateFormatOptions[]

The format strings or options (optional).

localeId?string

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

Returns:

Date

The parsed date.

Converts a string into a Number.

Parameters:valuestring

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 one (optional).

Returns:

number

The parsed number.

Splits the date format into objects containing information about each part of the pattern.

Parameters:formatstring | 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.

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

Parameters:valueany

The value to format.

formatany

The format to use.

localeId?string

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

Returns:

string

The formatted object as a string.

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).

Accessors

localeId

string

Specifies or gets the current locale ID.