Skip to content

@serenity-is/corelib / DateFormat

Interface: DateFormat

Defined in: src/base/formatting.ts:28

Locale settings for date/time formatting, mirroring .NET DateTimeFormatInfo.

Remarks

Consumed by formatDate and parseDate via Culture.

Extended by

Properties

amDesignator?

optional amDesignator: string

Defined in: src/base/formatting.ts:38

Designator for AM hours (used with t/tt tokens).

Default Value

"AM".


dateFormat?

optional dateFormat: string

Defined in: src/base/formatting.ts:32

Default date-only format string (e.g. "dd/MM/yyyy").


dateOrder?

optional dateOrder: string

Defined in: src/base/formatting.ts:34

Token order for parsing ambiguous numeric dates: "dmy", "mdy", or "ymd".


dateSeparator?

optional dateSeparator: string

Defined in: src/base/formatting.ts:30

Character separating date parts (e.g. "/" or ".").


dateTimeFormat?

optional dateTimeFormat: string

Defined in: src/base/formatting.ts:36

Default combined date+time format string (e.g. "dd/MM/yyyy HH:mm:ss").


dayNames?

optional dayNames: string[]

Defined in: src/base/formatting.ts:46

Full day names starting with Sunday — 7 entries.


firstDayOfWeek?

optional firstDayOfWeek: number

Defined in: src/base/formatting.ts:44

Index of the first day of the week (0 = Sunday, 1 = Monday).


minimizedDayNames?

optional minimizedDayNames: string[]

Defined in: src/base/formatting.ts:50

Two-letter day names (e.g. "Su", "Mo"). — 7 entries.


monthGenitiveNames?

optional monthGenitiveNames: string[]

Defined in: src/base/formatting.ts:60

Full month names in the genitive case, used by formatDate instead of monthNames when the format also has a day number (d or dd), as .NET does, e.g. "17 listopada" instead of "17 listopad" in Polish. Not set when they are the same as the month names, which they are in most languages.


monthNames?

optional monthNames: string[]

Defined in: src/base/formatting.ts:52

Full month names starting with January — 12 entries plus a trailing empty slot for compatibility.


pmDesignator?

optional pmDesignator: string

Defined in: src/base/formatting.ts:40

Designator for PM hours (used with t/tt tokens).

Default Value

"PM".


shortDayNames?

optional shortDayNames: string[]

Defined in: src/base/formatting.ts:48

Abbreviated day names (e.g. "Sun", "Mon"). — 7 entries.


shortMonthGenitiveNames?

optional shortMonthGenitiveNames: string[]

Defined in: src/base/formatting.ts:62

Abbreviated month names in the genitive case, see monthGenitiveNames. Not set when they are the same as shortMonthNames.


shortMonthNames?

optional shortMonthNames: string[]

Defined in: src/base/formatting.ts:54

Abbreviated month names (e.g. "Jan", "Feb"). — 12 entries plus a trailing empty slot.


timeSeparator?

optional timeSeparator: string

Defined in: src/base/formatting.ts:42

Character separating time parts.

Default Value

":".