@telerik/kendo-intl
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -0,8 +1,61 @@ | ||
/** | ||
* Settings for the dateFormatNames function. | ||
*/ | ||
export interface DateFormatNameOptions { | ||
type: string; | ||
nameType: string; | ||
lower?: string; | ||
/** | ||
* Specifies the type of names. | ||
*/ | ||
type: 'dayPeriods' | 'days' | 'months' | 'quarters' | 'eras'; | ||
/** | ||
* Specifies the names form. | ||
*/ | ||
nameType: 'abbreviated' | 'narrow' | 'short' | 'wide'; | ||
/** | ||
* Specifies if the returned names should be converted to lower case. | ||
*/ | ||
lower?: boolean; | ||
/** | ||
* Specifies whether the standalone names should be returned. | ||
*/ | ||
standAlone?: string; | ||
} | ||
/** | ||
* Returns the names from the specified locale based on the options. | ||
* | ||
* @param locale The locale id which defines the locale from which the names should be retrieved. | ||
* @param options The options that determine the returned names. | ||
* @returns The date format names. | ||
*/ | ||
export function dateFormatNames(locale: string, options: DateFormatNameOptions): any; | ||
/** | ||
* Returns the first day index starting from Sunday based on the specified locale. | ||
* | ||
* @param locale The locale id. | ||
* @returns The first day index. | ||
*/ | ||
export function firstDay(locale: string): number; | ||
/** | ||
* Loads CLDR data. | ||
* | ||
* @param data The CLDR data to be loaded. Accepts multiple parameters. | ||
*/ | ||
export function load(...data: any[]): void; | ||
/** | ||
* Returns the number symbols from the specified locale. | ||
* | ||
* @param locale The locale id which defines the locale for which the number symbols should be returned. | ||
* @returns The number symbols. | ||
*/ | ||
export function numberSymbols(locale: string): any; | ||
/** | ||
* @hidden | ||
*/ | ||
export interface CurrencyDisplayOptions { | ||
@@ -14,12 +67,30 @@ currency: string; | ||
/** | ||
* @hidden | ||
*/ | ||
export function currencyDisplay(locale: string, options: CurrencyDisplayOptions): any; | ||
/** | ||
* @hidden | ||
*/ | ||
export function currencyDisplays(locale: string, currency: string): any; | ||
/** | ||
* @hidden | ||
*/ | ||
export function currencyFractionOptions(locale: string): any; | ||
export function dateFormatNames(locale: string, options: DateFormatNameOptions): any; | ||
export function dateFormatNames(locale: string): any; | ||
export function firstDay(locale: string): number; | ||
export function load(...data: any[]): void; | ||
/** | ||
* @hidden | ||
*/ | ||
export function localeCurrency(locale: string): any; | ||
/** | ||
* @hidden | ||
*/ | ||
export function localeInfo(locale: string): any; | ||
export function numberSymbols(locale: string): any; | ||
/** | ||
* @hidden | ||
*/ | ||
export function territoryCurrencyCode(territory: string): any; |
@@ -0,22 +1,104 @@ | ||
/** | ||
* Settings for the formatDate and parseDate functions. | ||
*/ | ||
export interface DateFormatOptions { | ||
/** | ||
* Defines the skeleton format used to get the pattern from the locale calendar [`availableFormats`](http://www.unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems). | ||
*/ | ||
skeleton?: string; | ||
date?: string; | ||
time?: string; | ||
datetime?: string; | ||
era?: string; | ||
year?: string; | ||
month?: string; | ||
day?: string; | ||
weekday?: string; | ||
hour?: string; | ||
/** | ||
* Specifies which of the locale `dateFormats` should be used to format the value. | ||
*/ | ||
date?: 'short' | 'medium' | 'long' | 'full'; | ||
/** | ||
* Specifies which of the locale `timeFormats` should be used to format the value. | ||
*/ | ||
time?: 'short' | 'medium' | 'long' | 'full'; | ||
/** | ||
* Specifies which of the locale `dateTimeFormats` should be used to format the value. | ||
*/ | ||
datetime?: 'short' | 'medium' | 'long' | 'full'; | ||
/** | ||
* Specifies how should the date era be formatted. | ||
*/ | ||
era?: 'narrow' | 'short' | 'long'; | ||
/** | ||
* Specifies how the date year should be formatted. | ||
*/ | ||
year?: 'numeric' | '2-digit'; | ||
/** | ||
* Specifies how the date month should be formatted. | ||
*/ | ||
month?: 'numeric' | '2-digit' | 'narrow' | 'short' | 'long'; | ||
/** | ||
* Specifies how the day of the month should be formatted. | ||
*/ | ||
day?: 'numeric' | '2-digit'; | ||
/** | ||
* Specifies how the day of the week should be formatted. | ||
*/ | ||
weekday?: 'narrow' | 'short' | 'long'; | ||
/** | ||
* Specifies how the hours should be formatted. | ||
*/ | ||
hour?: 'numeric' | '2-digit'; | ||
/** | ||
* Specifies if a 12-hour time set should be used for the formatting. | ||
*/ | ||
hour12?: boolean; | ||
minute?: string; | ||
second?: string; | ||
timeZoneName?: string; | ||
/** | ||
* Specifies how the minutes should be formatted. | ||
*/ | ||
minute?: 'numeric' | '2-digit'; | ||
/** | ||
* Specifies how the seconds should be formatted. | ||
*/ | ||
second?: 'numeric' | '2-digit'; | ||
/** | ||
* Specifies how the timezone should be formatted. | ||
*/ | ||
timeZoneName?: 'short' | 'long'; | ||
} | ||
export function formatDate(value: Date, format: String|DateFormatOptions, locale?: string): string; | ||
/** | ||
* Converts a `Date` object to a string based on the specified format and locale. | ||
* | ||
* @param value Defines the date to be formatted. | ||
* @param format Defines a string representing a predefined or custom date format, or a configuration object. | ||
* @param locale The optional locale id. If not specified, the `"en"` locale id is used. | ||
* @returns The formatted date. | ||
*/ | ||
export function formatDate(value: Date, format: string|DateFormatOptions, locale?: string): string; | ||
export function parseDate(value: string, format?: String|DateFormatOptions|Array<String>|Array<DateFormatOptions>, locale?: string): Date; | ||
/** | ||
* Converts a string to a `Date` object based on the specified format and locale. | ||
* | ||
* @param value Defines the string to be parsed. | ||
* @param format Defines a string representing a predefined or custom date format, a configuration object, or an array of formats that should be used to parse the value. | ||
* @param locale The optional locale id. If not specified, the `"en"` locale id is used. | ||
* @returns The parsed date. | ||
*/ | ||
export function parseDate(value: string, format?: string | DateFormatOptions | string[] | DateFormatOptions[], locale?: string): Date; | ||
export function dateFormatString(value: Date, format: String|DateFormatOptions, locale?: string): string; | ||
/** | ||
* Returns the full format based on the Date object and the specified format. If no format is provided, the default short date format is used. | ||
* | ||
* @param value The date to format. | ||
* @param format The format string or options. | ||
* @param locale The optional locale id. If not specified, the `"en"` locale id is used. | ||
* @returns The full date format. | ||
*/ | ||
export function dateFormatString(value: Date, format: string|DateFormatOptions, locale?: string): string; |
@@ -1,2 +0,19 @@ | ||
export function toString(value: any, format: string, locale?: string): string; | ||
export function format(format: string, values: Array<any>, locale?: string): string; | ||
/** | ||
* Formats dates and numbers based on the specified format and locale. | ||
* | ||
* @param value The value to be formatted. | ||
* @param format A string representing a predefined or custom date or number format, or a configuration object. | ||
* @param locale The optional locale id. If not specified, the `"en"` locale id is used. | ||
* @returns The formatted value. | ||
*/ | ||
export function toString(value: string | Date | number, format: string | any, locale?: string): string; | ||
/** | ||
* Replaces the format string placeholders with the provided values based on the index. | ||
* | ||
* @param format The format string. | ||
* @param values The values that should be replaced in the format string. | ||
* @param locale The optional locale id. If not specified, the `"en"` locale id is used. | ||
* @returns The format string with replaced formatted values. | ||
*/ | ||
export function format(format: string, values: any[], locale?: string): string; |
@@ -0,12 +1,65 @@ | ||
/** | ||
* Settings for the formatNumber and parseNumber functions. | ||
*/ | ||
export interface NumberFormatOptions { | ||
style?: string; | ||
/** | ||
* Specifies the format style. | ||
*/ | ||
style?: 'decimal' | 'currency' | 'precent' | 'scientific'; | ||
/** | ||
* Defines the currency code of the currency used in the formatting. If not specified, the default currency for the locale is used. | ||
*/ | ||
currency?: string; | ||
currencyDisplay?: string; | ||
/** | ||
* Specifies how to display the currency. | ||
*/ | ||
currencyDisplay?: 'symbol' | 'code' | 'name'; | ||
/** | ||
* Specifies whether to use grouping separators. | ||
*/ | ||
useGrouping?: boolean; | ||
/** | ||
* Defines the minimum number of integer digits to be used in the formatting. | ||
*/ | ||
minimumIntegerDigits?: number; | ||
/** | ||
* Defines the minimum number of fraction digits to use. | ||
* The default value for the decimal and percent formatting is 0 (zero). | ||
* The default value of the currency formatting is the number of digits for the currency from the supplemental `currencyData` or 2 if no info is provided for the currency. | ||
*/ | ||
minimumFractionDigits?: number; | ||
/** | ||
* Defines the maximum number of fraction digits to be used. | ||
* The default value of the decimal formatting is the greater one between `minimumFractionDigits` and 3. | ||
* The default value of the currency formatting is the greater one between `minimumFractionDigits` and the number of digits for the currency from the supplemental `currencyData` or 2 if no info is provided for the currency. | ||
* The default value of the percent formatting is the greater one between `minimumFractionDigits` and 0 (zero). | ||
*/ | ||
maximumFractionDigits?: number; | ||
} | ||
export function parseNumber(value: string, locale?: string, format?: String|NumberFormatOptions): number; | ||
/** | ||
* Converts a string to a `Number` based on the specified locale. | ||
* | ||
* @param value The string to be parsed. | ||
* @param locale The locale id defining the locale which information should be used to parse the string. | ||
* @param format The format used to parse the string. Usefull if parsing non-default currencies. | ||
* @returns The parsed number. | ||
*/ | ||
export function parseNumber(value: string, locale?: string, format?: string|NumberFormatOptions): number; | ||
/** | ||
* Converts a `Number` to a string based on the specified format and locale. | ||
* | ||
* @param value The number to be formatted. | ||
* @param format The format to be applied. | ||
* @param locale The locale id defining the locale which information should be used for the formatting. | ||
* @returns The formatted number. | ||
*/ | ||
export function formatNumber(value: number, format: string|NumberFormatOptions, locale?: string): string; |
{ | ||
"name": "@telerik/kendo-intl", | ||
"description": "A package exporting functions for date and number parsing and formatting", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
532399
5296