@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?
optionalamDesignator:string
Defined in: src/base/formatting.ts:38
Designator for AM hours (used with t/tt tokens).
Default Value
"AM".
Inherited from
currencySymbol?
optionalcurrencySymbol:string
Defined in: src/base/formatting.ts:21
Symbol appended for currency ("c") formatting.
Default Value
"$".
Inherited from
dateFormat?
optionaldateFormat:string
Defined in: src/base/formatting.ts:32
Default date-only format string (e.g. "dd/MM/yyyy").
Inherited from
dateOrder?
optionaldateOrder:string
Defined in: src/base/formatting.ts:34
Token order for parsing ambiguous numeric dates: "dmy", "mdy", or "ymd".
Inherited from
dateSeparator?
optionaldateSeparator:string
Defined in: src/base/formatting.ts:30
Character separating date parts (e.g. "/" or ".").
Inherited from
dateTimeFormat?
optionaldateTimeFormat:string
Defined in: src/base/formatting.ts:36
Default combined date+time format string (e.g. "dd/MM/yyyy HH:mm:ss").
Inherited from
dayNames?
optionaldayNames:string[]
Defined in: src/base/formatting.ts:46
Full day names starting with Sunday — 7 entries.
Inherited from
decimalDigits?
optionaldecimalDigits: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
decimalSeparator
decimalSeparator:
string
Defined in: src/base/formatting.ts:7
Character used as the decimal separator (e.g. "." or ",").
Inherited from
firstDayOfWeek?
optionalfirstDayOfWeek:number
Defined in: src/base/formatting.ts:44
Index of the first day of the week (0 = Sunday, 1 = Monday).
Inherited from
groupSeparator?
optionalgroupSeparator:string
Defined in: src/base/formatting.ts:9
Character used to group thousands (e.g. "," or ".").
Inherited from
minimizedDayNames?
optionalminimizedDayNames:string[]
Defined in: src/base/formatting.ts:50
Two-letter day names (e.g. "Su", "Mo"). — 7 entries.
Inherited from
monthGenitiveNames?
optionalmonthGenitiveNames: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
monthNames?
optionalmonthNames: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
nanSymbol?
optionalnanSymbol:string
Defined in: src/base/formatting.ts:17
String rendered for NaN values.
Inherited from
negativeSign?
optionalnegativeSign:string
Defined in: src/base/formatting.ts:15
Symbol for negative numbers.
Default Value
"-".
Inherited from
percentSymbol?
optionalpercentSymbol:string
Defined in: src/base/formatting.ts:19
Symbol appended for percent ("p") formatting.
Default Value
"%".
Inherited from
pmDesignator?
optionalpmDesignator:string
Defined in: src/base/formatting.ts:40
Designator for PM hours (used with t/tt tokens).
Default Value
"PM".
Inherited from
positiveSign?
optionalpositiveSign:string
Defined in: src/base/formatting.ts:13
Symbol for positive numbers (rarely displayed).
Default Value
"+".
Inherited from
shortDayNames?
optionalshortDayNames:string[]
Defined in: src/base/formatting.ts:48
Abbreviated day names (e.g. "Sun", "Mon"). — 7 entries.
Inherited from
shortMonthGenitiveNames?
optionalshortMonthGenitiveNames: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?
optionalshortMonthNames:string[]
Defined in: src/base/formatting.ts:54
Abbreviated month names (e.g. "Jan", "Feb"). — 12 entries plus a trailing empty slot.
Inherited from
stringCompare()?
optionalstringCompare: (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?
optionaltimeSeparator:string
Defined in: src/base/formatting.ts:42
Character separating time parts.
Default Value
":".
Inherited from
toUpper()?
optionaltoUpper: (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.