# changeDay Type documentation

## TypeScript declaration

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

**Kind:** constant

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

Update date/day of give date without changing the month. In case the day exceed the number of days in the current month the last day in month will be assigned.

Returns: the updated date object.

```
(date: Date, day: number) => Date = ...
```

```
changeDay(date: Date, day: number): Date
```

Update date/day of give date without changing the month. In case the day exceed the number of days in the current month the last day in month will be assigned.

Returns: the updated date object.

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [date](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L422-L422>) | `Date` |  | • the date object to update the day. |
| [day](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L422-L422>) | `number` |  | • the day which shall be set. |

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