Skip to main content Link Search Menu Expand Document (external link)

DateTimeFormat.ts overview

Type of a MDateTimeToken (see https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). Values are dense from 0 so a MDateTimeContext can resolve a token to its MTemplatePlaceholder by plain array indexing.


Exports Grouped by Category


Constructors

make

Constructs a MDateTimeFormat from the given string separators and Token’s

Signature

declare const make: (...parts: Type) => Type

Source

Instances

basicIso8601

MDateTimeFormat instance for the basic ISO 8601 date format (YYYYMMDD, e.g. 20050605).

Signature

declare const basicIso8601: Type

Source

euDate

MDateTimeFormat instance for the European date format with slashes (DD/MM/YYYY, e.g. 05/06/2005).

Signature

declare const euDate: Type

Source

euDotDate

MDateTimeFormat instance for the European date format with dots (DD.MM.YYYY, e.g. 05.06.2005).

Signature

declare const euDotDate: Type

Source

iso8601

MDateTimeFormat instance for the ISO 8601 date format (YYYY-MM-DD, e.g. 2005-06-05).

Signature

declare const iso8601: Type

Source

isoDateTime

MDateTimeFormat instance for the ISO 8601 date-time format without milliseconds (YYYY-MM- DDTHH:mm:ss, e.g. 2005-06-05T14:05:05).

Signature

declare const isoDateTime: Type

Source

isoDateTimeMs

MDateTimeFormat instance for the ISO 8601 date-time format with milliseconds (YYYY-MM- DDTHH:mm:ss.SSS, e.g. 2005-06-05T14:05:05.007).

Signature

declare const isoDateTimeMs: Type

Source

longDate

MDateTimeFormat instance for a long date format (MMMM d, yyyy, e.g. June 5, 2005). The month name is locale-dependent and requires an appropriate MDateTimeContext.

Signature

declare const longDate: Type

Source

shortDate

MDateTimeFormat instance for a short date format (MMM d, yyyy, e.g. Jun 5, 2005). The abbreviated month name is locale-dependent and requires an appropriate MDateTimeContext.

Signature

declare const shortDate: Type

Source

time12h

MDateTimeFormat instance for the 12-hour time format without seconds (KK:mm a, e.g. 02:05 PM).

Signature

declare const time12h: Type

Source

time12hWithSeconds

MDateTimeFormat instance for the 12-hour time format with seconds (KK:mm:ss a, e.g. 02:05:05 PM).

Signature

declare const time12hWithSeconds: Type

Source

time24h

MDateTimeFormat instance for the 24-hour time format without seconds (HH:mm, e.g. 14:05).

Signature

declare const time24h: Type

Source

time24hWithSeconds

MDateTimeFormat instance for the 24-hour time format with seconds (HH:mm:ss, e.g. 14:05:05).

Signature

declare const time24hWithSeconds: Type

Source

usDate

MDateTimeFormat instance for the US date format (MM/DD/YYYY, e.g. 06/05/2005).

Signature

declare const usDate: Type

Source

Models

Type (interface)

Type that represents a MDateTimeFormat. Strings are separators (printed as is); Token’s are placeholders resolved against a MDateTimeContext

Signature

export interface Type extends ReadonlyArray<string | Token> {}

Source