# getWeekYear

Industry: Core

## Signature

```ts
getWeekYear(value: string): number | null
```

Return the ISO 8601 week-numbering year `value` belongs to.

- Distinct from `value`'s calendar year — late-December/early-January dates can belong to a different ISO week-year than their calendar year (e.g. 2024-12-30 is a Monday in ISO week 1 of **2025**). Pair this with `weekOfYearForDate` when bucketing by week: a week number alone is ambiguous without the week-year it belongs to.
- Uses `Temporal.PlainDate.yearOfWeek` (ISO weeks: Monday-start, week 1 contains the year's first Thursday).
- Returns null on invalid input.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | ISO PlainDate string |

## Returns

ISO week-numbering year, or null on invalid input

## Examples

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

getWeekYear("2024-06-15") // 2024
```

## Source

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