# isBetweenDate

Industry: Core

## Signature

```ts
isBetweenDate(date: string, start: string, end: string, options?: { inclusiveStart?: boolean; inclusiveEnd?: boolean; }): boolean
```

Return true when `date` is between `start` and `end` (inclusive by default).

- Uses Temporal.PlainDate.compare to compare dates.
- Returns false if start &gt; end (invalid range).
- Returns false if any input is invalid.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `date` | `string` | ISO PlainDate string to check |
| `start` | `string` | ISO PlainDate string for the start of the range |
| `end` | `string` | ISO PlainDate string for the end of the range |

## Options

**options**

Whether each end of the range counts as inside it

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `inclusiveStart?` | `boolean` | `true` | Whether `date` equal to `start` counts as inside the range. `false` requires it to be after `start`. |
| `inclusiveEnd?` | `boolean` | `true` | Whether `date` equal to `end` counts as inside the range. `false` requires it to be before `end`. |

## Returns

boolean indicating whether date is between start and end

## Examples

```ts
import { isBetweenDate } from "@northguild/gmt/plain/compare";

isBetweenDate("2024-02-29", "2024-02-01", "2024-02-28") // false
```

## Source

[plain/compare/isBetweenDate.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/plain/compare/isBetweenDate.ts)
