---
title: "Read the week start and units from locale · Agent Wranglers"
url: https://agentwranglers.se/playbook/localization/formatting/week-and-units-from-cldr
id: LOC-28
level: Recommended
updated: 2026-10-22
build: a2a6bdfed830
tokens: 758
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Read the week start and units from locale data

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Formatting](https://agentwranglers.se/playbook/localization/formatting.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: LOC-28
- Level: Recommended
- Chapter: [Formatting](https://agentwranglers.se/playbook/localization/formatting.md)
- Rule: Read the first day of the week, the weekend, the 12 or 24 hour clock and the measurement system from CLDR locale data. Never hard-code them.
- Check: A component test renders the date picker in `sv-SE`, `en-US` and `ar-EG`. The first column is Monday, Sunday and Saturday.
- How: The week starts on Monday in Sweden, Sunday in the United States and Saturday in many Middle Eastern countries. CLDR publishes these facts per region as week data. Read them from your i18n library, such as `Intl.Locale` and its `getWeekInfo()` in JavaScript runtimes that have it, Babel in Python or ICU4J in Java. Let a user override them in their settings, stored next to [the locale and time zone](https://agentwranglers.se/playbook/localization/time-and-time-zones/locale-and-time-zone-preferences.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
const ISO_SUNDAY = 7;
const firstDayOf = tag => {
  const locale = new Intl.Locale(tag);
  return locale.getWeekInfo?.().firstDay ?? locale.weekInfo?.firstDay ?? ISO_SUNDAY;
};
firstDayOf('sv-SE'); // 1, Monday
```

### Python example

```python
from babel import Locale

Locale.parse("sv_SE").first_week_day  # 0, Monday
Locale.parse("en_US").first_week_day  # 6, Sunday
```

## Sources

- [Unicode LDML Part 4 (Week data)](https://www.unicode.org/reports/tr35/tr35-dates.html)
- [ECMA-402 (Intl.Locale.prototype.getWeekInfo)](https://tc39.es/ecma402/)

## Related rules

- LOC-22 [Store language and time zone as two separate settings](https://agentwranglers.se/playbook/localization/time-and-time-zones/locale-and-time-zone-preferences.md) in Localization

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/localization/formatting/week-and-units-from-cldr">Agent Wranglers localization playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Take the currency from the amount and not from the locale](https://agentwranglers.se/playbook/localization/formatting/currency-from-the-amount.md)
- Next: [Format lists and durations with locale data](https://agentwranglers.se/playbook/localization/formatting/list-and-duration-formats.md)
- [Formatting](https://agentwranglers.se/playbook/localization/formatting.md)
