Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Culture

A thin wrapper around the IntlAdapter to avoid the need to pass a locale id to every method. Ensure to instantiate this as an app-wide singleton to use the same locale id everywhere

Hierarchy

  • Culture

Index

Constructors

constructor

Properties

currentLocale

currentLocale: string

Private intl

Methods

compare

  • compare(x: string, y: string, options: CollatorOptions): number
  • Parameters

    • x: string
    • y: string
    • options: CollatorOptions

    Returns number

formatDate

  • formatDate(value: Date | number | string, options: DateTimeFormatOptions): string
  • Parameters

    • value: Date | number | string
    • options: DateTimeFormatOptions

    Returns string

formatDateRange

  • formatDateRange(start: Date | number | string, end: Date | number | string, options?: Intl.DateTimeFormatOptions): string
  • Parameters

    • start: Date | number | string
    • end: Date | number | string
    • Optional options: Intl.DateTimeFormatOptions

    Returns string

formatNumber

  • formatNumber(value: number, options: NumberFormatOptions): string
  • Parameters

    • value: number
    • options: NumberFormatOptions

    Returns string

formatTimeRange

  • formatTimeRange(start: Date | number | string, end: Date | number | string, options?: Intl.DateTimeFormatOptions): string
  • Parameters

    • start: Date | number | string
    • end: Date | number | string
    • Optional options: Intl.DateTimeFormatOptions

    Returns string

parseDate

  • parseDate(date: string, defaultValue?: Date): Date
  • Parameters

    • date: string
    • Optional defaultValue: Date

    Returns Date

Generated using TypeDoc