# endOfYearMonth

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

## Signature

```ts
endOfYearMonth(value: string): string
```

The last day of a year-month, as an ISO date.

- February ends on the 29th in a leap year and on the 28th in any other.
- The highest year-month, `+275760-09`, holds only `+275760-09-01` to `+275760-09-13`, so its last day is not a PlainDate and the result is `""`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | a year-month, `YYYY-MM` |

## Returns

the ISO date of the last day, or `""` when `value` is not a valid year-month or its last day is outside the PlainDate range

## Examples

```ts
import { endOfYearMonth } from "@northguild/gmt/plain/calculate";

endOfYearMonth("2026-10") // "2026-10-31"
```

## Source

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