# getWeekOfYear Type documentation

## TypeScript declaration

### [getWeekOfYear](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L120-L132>)

**Kind:** constant

```
import { getWeekOfYear } from '@siemens/element-ng/datepicker';
```

Returns the ISO-8601 week number for the user's week containing the specified date. ISO-8601 weeks always start on Monday. When the user's week starts on Sunday or Saturday, the date is adjusted to find the corresponding ISO week (based on the Thursday rule). The first week of a year is the week that contains the first Thursday of the year (='First 4-day week'). The highest week number in a year is either 52 or 53.

Returns: The number of the Week

```
(date: Date, weekStart: WeekStart) => number = ...
```

```
getWeekOfYear(date: Date, weekStart: WeekStart): number
```

Returns the ISO-8601 week number for the user's week containing the specified date. ISO-8601 weeks always start on Monday. When the user's week starts on Sunday or Saturday, the date is adjusted to find the corresponding ISO week (based on the Thursday rule). The first week of a year is the week that contains the first Thursday of the year (='First 4-day week'). The highest week number in a year is either 52 or 53.

Returns: The number of the Week

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [date](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L120-L120>) | `Date` |  | \-The JavaScript date object. |
| [weekStart](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L120-L120>) | `WeekStart` |  | \-Name of the first day of the week |

**Returns:** [number](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number>)

### Types Documentation

### [WeekStart](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/si-datepicker.model.ts#L9-L9>)

**Kind:** type alias

```
import type { WeekStart } from '@siemens/element-ng/datepicker';
```

```
type WeekStart = 'monday' | 'saturday' | 'sunday' | undefined
```
