Skip to main content

Module locale

Module locale 

Source
Expand description

Per-locale defaults: first day of week + segment-pattern.

Hand-curated for the top ~25 locales, matching CLDR. Any locale not listed falls back to ISO 8601: Monday first day, YYYY-MM-DD. Both defaults are overridable on the widget builder.

Functions§

first_day_of_week_for_locale
Default first day of week for the given locale tag (e.g. "en-US", "fr-FR"). Lookup is a longest-prefix match: a fully-qualified "en-US" resolves before the bare "en" family.
format_pattern_for_locale
Default date format pattern for the given locale tag. Uses the strftime subset described in pattern.rs.
prefers_12_hour_clock
Whether the given locale prefers a 12-hour clock (with AM/PM) for digital-UI time display. Returns false (24-hour) for any locale not explicitly listed — matching CLDR’s behaviour for the vast majority of locales worldwide. The few true cases are the English-speaking regions where digital-UI 12-hour display is the near-universal convention: US, Canada, Australia, New Zealand, Philippines, plus the en-IN/en-PK digital convention. Lookup is longest-prefix match, identical to format_pattern_for_locale and first_day_of_week_for_locale.