# getLocaleStartOfWeek

Industry: Core

## Signature

```ts
getLocaleStartOfWeek(value: string, locale: string | string[]): string
```

Return the start of the week containing `value`, using `locale`'s first day of week (e.g. fr-FR: Monday, ja-JP: Sunday).

- Resolves the locale's first day of week via `Intl.Locale.prototype.weekInfo`.
- Falls back to Monday if the runtime's `weekInfo` data doesn't resolve a first day for the locale.
- Distinct from `startOfDate(value, "week", { weekStartsOn })`, which takes an explicit ISO-biased `weekStartsOn` option instead of deriving it from a locale.
- Returns "" if `value` is invalid or `locale` is not a well-formed BCP 47 tag (ECMA-402 `IsWellFormedLanguageTag`). A well-formed tag with no matching locale data is not an error: it falls back to the host's default locale, as ECMA-402 `ResolveLocale` requires.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | ISO 8601 date string |
| `locale` | `string` \| `string[]` | BCP 47 locale tag (e.g. "fr-FR", "ja-JP", "en-US"), or a preference list of tags (ECMA-402; the first with locale data is read). Required: omitted, or an empty list (which ECMA-402 would resolve to the host default), returns "" |

## Returns

ISO 8601 date string for the start of `value`'s locale-relative week, or "" on invalid input

## Examples

```ts
import { getLocaleStartOfWeek } from "@northguild/gmt/plain/calculate";

getLocaleStartOfWeek("2024-02-29", "ja-JP") // "2024-02-25" (Sunday)
```

## Source

[plain/calculate/getLocaleStartOfWeek.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/plain/calculate/getLocaleStartOfWeek.ts)
