# isSameOrBetweenYears Type documentation

## TypeScript declaration

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

**Kind:** constant

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

Compare the current year is the same year or between start and end year.

Returns: true if the date is in the provided range.

```
(current: Date, from?: Date | undefined, to?: Date | undefined) => boolean = ...
```

```
isSameOrBetweenYears(current: Date, from?: Date, to?: Date): boolean
```

Compare the current year is the same year or between start and end year.

Returns: true if the date is in the provided range.

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [current](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L633-L633>) | `Date` |  | • the year object. |
| [from](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L633-L633>) (optional) | `Date` |  | • optional min year, if no value is provided we assume true for the min value. |
| [to](<https://github.com/siemens/element/blob/main/projects/element-ng/datepicker/date-time-helper.ts#L633-L633>) (optional) | `Date` |  | • optional max year, if no value is provided we assume true for the max value. |

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