# addDaysInRange Type documentation

## TypeScript declaration

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

**Kind:** constant

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

Calculate a new date based on the offset while considering the min and max date.

Returns: new date if the range is valid or original date

```
(current: Date, daysOffset: number, minDate?: Date | undefined, maxDate?: Date | undefined) => Date = ...
```

```
addDaysInRange(current: Date, daysOffset: number, minDate?: Date, maxDate?: Date): Date
```

Calculate a new date based on the offset while considering the min and max date.

Returns: new date if the range is valid or original date

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [current](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L389-L389>) | `Date` |  | • input date. |
| [daysOffset](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L390-L390>) | `number` |  | • numeric offset of days. |
| [minDate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L391-L391>) (optional) | `Date` |  |  |
| [maxDate](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L392-L392>) (optional) | `Date` |  |  |

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