# isValidDate

Industry: Core

## Signature

```ts
isValidDate(value: string): boolean
isValidDate(value: void | {} | null | undefined): boolean
isValidDate(value: unknown): value is string
```

Return true if `value` is a valid ISO PlainDate string.

- The whole string must match `plainDate` (a date, not a date-time).
- Accepts no annotation of any kind: a time zone (`[Europe/Paris]`), a calendar (`[u-ca=iso8601]`, `[u-ca=hebrew]`) or an elective one (`[foo=bar]`) returns `false`. `isValidCalendarDate` is the validator that reads a calendar.
- Rejects leap seconds (e.g., "2024-12-31T23:59:60").
- Rejects invalid dates (e.g., "2024-02-30").
- A value that is not a string, a `String` object included, returns `false`. A `true` result narrows an `unknown` value to `string`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | any value; a string is checked as an ISO PlainDate |

## Returns

boolean indicating validity

## Examples

```ts
import { isValidDate } from "@northguild/gmt/plain/validate";

isValidDate("2024-03-10") // true
```

## Source

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