Options
All
  • Public
  • Public/Protected
  • All
Menu

This module provides date and number formatting methods and supporting utilities.

Read more...

Hierarchy

  • intl

Index

Methods

convertDateFormatToIntlOptions

  • convertDateFormatToIntlOptions(format?: "short-date" | "short-date-short-time" | "short-date-short-time-24" | "short-date-long-time" | "short-date-long-time-24" | "long-month-day-year" | "long-month-day-year-short-time" | "long-month-day-year-short-time-24" | "long-month-day-year-long-time" | "long-month-day-year-long-time-24" | "day-short-month-year" | "day-short-month-year-short-time" | "day-short-month-year-short-time-24" | "day-short-month-year-long-time" | "day-short-month-year-long-time-24" | "long-date" | "long-date-short-time" | "long-date-short-time-24" | "long-date-long-time" | "long-date-long-time-24" | "long-month-year" | "short-month-year" | "year" | "short-time" | "long-time"): DateTimeFormatOptions
  • Parameters

    • Optional format: "short-date" | "short-date-short-time" | "short-date-short-time-24" | "short-date-long-time" | "short-date-long-time-24" | "long-month-day-year" | "long-month-day-year-short-time" | "long-month-day-year-short-time-24" | "long-month-day-year-long-time" | "long-month-day-year-long-time-24" | "day-short-month-year" | "day-short-month-year-short-time" | "day-short-month-year-short-time-24" | "day-short-month-year-long-time" | "day-short-month-year-long-time-24" | "long-date" | "long-date-short-time" | "long-date-short-time-24" | "long-date-long-time" | "long-date-long-time-24" | "long-month-year" | "short-month-year" | "year" | "short-time" | "long-time"

    Returns DateTimeFormatOptions

convertNumberFormatToIntlOptions

  • convertNumberFormatToIntlOptions(format?: NumberFormat): NumberFormatOptions

createJSONLoader

fetchMessageBundle

  • fetchMessageBundle(bundleId: string): Promise<any>
  • Loads a localized message bundle used with the current API locale.

    Read more...

    Parameters

    • bundleId: string

    Returns Promise<any>

formatDate

  • formatDate(value: number | Date, formatOptions?: DateTimeFormatOptions): string
  • Formats a Date or Number value to a string in the current locale.

    Read more...

    Parameters

    • value: number | Date
    • Optional formatOptions: DateTimeFormatOptions

    Returns string

formatNumber

  • formatNumber(value: number, formatOptions?: NumberFormatOptions): string
  • Formats a Number value to a string in the current locale.

    Read more...

    Parameters

    • value: number
    • Optional formatOptions: NumberFormatOptions

    Returns string

getLocale

  • getLocale(): string
  • Returns the current locale used by the API.

    Read more...

    Returns string

normalizeMessageBundleLocale

  • normalizeMessageBundleLocale(locale: void): any
  • Returns one of the known message bundle locale for an input locale.

    Read more...

    Parameters

    • locale: void

    Returns any

onLocaleChange

prefersRTL

  • prefersRTL(locale?: string): boolean
  • Provides right-to-left preference for input locale.

    Read more...

    Parameters

    • Optional locale: string

    Returns boolean

registerMessageBundleLoader

  • Registers a message loader to load specified message bundles needed for translating strings.

    Read more...

    Parameters

    Returns any

setLocale

  • setLocale(locale: string): void
  • Sets the locale used by the API.

    Read more...

    Parameters

    • locale: string

    Returns void

substitute

  • Use this to substitute keys in a template string with values from the argument data.

    Read more...

    Parameters

    Returns string

Generated using TypeDoc