# isValidMonthDay

:::caution[Unreleased]
Not in `@northguild/gmt` 1.20.0 on npm yet. It is on `main` and ships in the next release.
:::

## Signature

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

Return true if `value` is a valid ISO month-day string: `--MM-DD` or `MM-DD`.

- The part before the first annotation must match `plainMonthDay`: the extended form only (`--1225` and `1225` are refused, as `isValidDate` refuses `20241225`), with a day that exists in at least one year. `--02-29` is valid; `--02-30` and `--04-31` are not.
- Reads RFC 9557 annotations as `Temporal.PlainMonthDay.from` does: elective ones (`[foo=bar]`) and a time zone annotation are ignored, and an unknown critical one (`[!foo=bar]`) is rejected.
- The calendar must be `iso8601`, in any case (`[u-ca=ISO8601]` is accepted); any other calendar is refused, because a month-day without a year is read only in the ISO calendar.
- Rejects a year, a time, a `Z` and an offset.
- 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 month-day |

## Returns

boolean indicating validity

## Examples

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

isValidMonthDay("--12-25") // true
```

## Source

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