Skip to content

@serenity-is/corelib / Locale

Interface: Locale

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

Combined locale settings, mirroring .NET CultureInfo.

Remarks

Extends both NumberFormat and DateFormat with string comparison helpers.

Extends

Properties

amDesignator?

optional amDesignator: string

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

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

Default Value

"AM".

Inherited from

DateFormat.amDesignator


currencySymbol?

optional currencySymbol: string

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

Symbol appended for currency ("c") formatting.

Default Value

"$".

Inherited from

NumberFormat.currencySymbol


dateFormat?

optional dateFormat: string

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

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

Inherited from

DateFormat.dateFormat


dateOrder?

optional dateOrder: string

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

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

Inherited from

DateFormat.dateOrder


dateSeparator?

optional dateSeparator: string

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

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

Inherited from

DateFormat.dateSeparator


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").

Inherited from

DateFormat.dateTimeFormat


dayNames?

optional dayNames: string[]

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

Full day names starting with Sunday — 7 entries.

Inherited from

DateFormat.dayNames


decimalDigits?

optional decimalDigits: number

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

Default number of fractional digits for "f" / "n" / "c" / "p" formats.

Default Value

2 (Invariant).

Inherited from

NumberFormat.decimalDigits


decimalSeparator

decimalSeparator: string

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

Character used as the decimal separator (e.g. "." or ",").

Inherited from

NumberFormat.decimalSeparator


firstDayOfWeek?

optional firstDayOfWeek: number

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

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

Inherited from

DateFormat.firstDayOfWeek


groupSeparator?

optional groupSeparator: string

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

Character used to group thousands (e.g. "," or ".").

Inherited from

NumberFormat.groupSeparator


minimizedDayNames?

optional minimizedDayNames: string[]

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

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

Inherited from

DateFormat.minimizedDayNames


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.

Inherited from

DateFormat.monthGenitiveNames


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.

Inherited from

DateFormat.monthNames


nanSymbol?

optional nanSymbol: string

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

String rendered for NaN values.

Inherited from

NumberFormat.nanSymbol


negativeSign?

optional negativeSign: string

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

Symbol for negative numbers.

Default Value

"-".

Inherited from

NumberFormat.negativeSign


percentSymbol?

optional percentSymbol: string

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

Symbol appended for percent ("p") formatting.

Default Value

"%".

Inherited from

NumberFormat.percentSymbol


pmDesignator?

optional pmDesignator: string

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

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

Default Value

"PM".

Inherited from

DateFormat.pmDesignator


positiveSign?

optional positiveSign: string

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

Symbol for positive numbers (rarely displayed).

Default Value

"+".

Inherited from

NumberFormat.positiveSign


shortDayNames?

optional shortDayNames: string[]

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

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

Inherited from

DateFormat.shortDayNames


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.

Inherited from

DateFormat.shortMonthGenitiveNames


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.

Inherited from

DateFormat.shortMonthNames


stringCompare()?

optional stringCompare: (a, b) => number

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

Locale-aware string comparator, analogous to String.Compare.

Parameters

a

string

First string to compare (may be null).

b

string

Second string to compare (may be null).

Returns

number

Negative if a < b, positive if a > b, 0 if equal.


timeSeparator?

optional timeSeparator: string

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

Character separating time parts.

Default Value

":".

Inherited from

DateFormat.timeSeparator


toUpper()?

optional toUpper: (a) => string

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

Locale-aware upper-casing function.

Parameters

a

string

String to convert.

Returns

string

The upper-cased string.