@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
81 lines (80 loc) • 2.46 kB
TypeScript
/**
* Internationalization/Globalization class.
* @dynamic
*/
export declare class Globalization {
private static fullTimeOptions;
private static dateTimeOnlyOptions;
private static dateTimeOnlyShortOptions;
private static dateOnlyOptions;
private static timeOnlyOptions;
/**
* Caching format objects for better performance.
*/
private static internalFullTimeFormat;
private static internalDateTimeOnlyShortFormat;
private static internalDateTimeOnlyFormat;
private static internalDateOnlyFormat;
private static internalTimeOnlyFormat;
private static internalNumberFormat;
private static get fullTimeFormat();
private static get dateTimeOnlyFormat();
private static get dateTimeOnlyShortFormat();
private static get dateOnlyFormat();
private static get timeOnlyFormat();
private static get numberFormat();
/**
* Gets the locale ID for regional format.
*
* This ID must be used for any locale function calls.
*
* - String.prototype.localeCompare()
* - Number.prototype.toLocaleString()
* - Date.prototype.toLocaleString()
* - Date.prototype.toLocaleDateString()
* - Date.prototype.toLocaleTimeString()
*
* @return string the local ID.
*/
static get localeId(): string;
/**
* Format with full time to display.
*
* @param data the date object.
*/
static fullTime(date: Date): string;
/**
* Format with date time only to display.
*
* @param data the date object.
*/
static dateTimeOnly(date: Date): string;
/**
* Format with date time only without seconds to display.
*
* @param data the date object.
*/
static dateTimeOnlyShort(date: Date): string;
/**
* Format with date only to display.
*
* @param data the date object.
*/
static dateOnly(date: Date): string;
/**
* Format with time only to display.
*
* @param data the date object.
*/
static timeOnly(date: Date): string;
/**
* Format simple number to display.
*
* (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat to add
* more feature such as currency display)
*
* @param data the number data.
* @param options the number formatting options.
*/
static number(data: number, options?: Intl.NumberFormatOptions): string;
}