# getIsoWeekDate

Industry: Core

## Signature

```ts
getIsoWeekDate(value: string): { year: number; week: number; weekday: number; } | null
```

Return the ISO 8601 week date — week-numbering year, week and weekday — for `value`.

- Vessel schedules, production plans and retail reports are published by week number, and a week number alone is ambiguous: the week-numbering year is not the calendar year at either end of a year, so all three fields come back together rather than as three calls a caller could combine inconsistently.
- A week-numbering year has 53 weeks roughly every five to six years, and 52 otherwise.
- `value` must be zoneless — an ISO date or datetime, as `isValidIsoDateLike` accepts. An offset, a `Z` or a bracketed zone makes it a moment rather than a calendar date; convert it in the zone you mean first (`convertUtcToZoned` then `convertZonedToPlainDateTime`), or floor it with `floorToZone`.
- Returns null on invalid input.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | zoneless ISO 8601 date or datetime string (e.g. "2024-06-15") |

## Returns

&#123; year, week, weekday &#125;, or null on invalid input

**Members**

| Member | Type | Description |
| --- | --- | --- |
| `year` | `number` | The ISO 8601 week-numbering year: the calendar year that holds the Thursday of the date's week. It differs from the date's own calendar year for some dates in late December and early January. |
| `week` | `number` | The ISO 8601 week number, 1 through 53. Week 1 is the week that holds the year's first Thursday, and weeks start on Monday. |
| `weekday` | `number` | The ISO 8601 day of the week, 1 (Monday) through 7 (Sunday). |

## Examples

```ts
import { getIsoWeekDate } from "@northguild/gmt/calendar/calculate";

getIsoWeekDate("2024-06-15") // { year: 2024, week: 24, weekday: 6 }
```

## Source

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