# getWeekStartDate Type documentation

## TypeScript declaration

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

**Kind:** constant

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

Get the first date of the week based on the input date.

Returns: a new date object which is the start of the current week.

```
(current: Date, weekStartDay?: WeekStart) => Date = ...
```

```
getWeekStartDate(current: Date, weekStartDay?: WeekStart = 'monday'): Date
```

Get the first date of the week based on the input date.

Returns: a new date object which is the start of the current week.

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [current](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L492-L492>) | `Date` |  | • a date object from where the last date of a week is derived. |
| [weekStartDay](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L492-L492>) (optional) | `WeekStart` | `'monday'` | • optional when a week shall start. |

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

### 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
```
