# areYearMonthsEqual

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

## Signature

```ts
areYearMonthsEqual(a: string, b: string): boolean
```

Check whether two year-month strings (`YYYY-MM`) name the same year and month.

- Accepts both year forms, so `2026-10` and `+002026-10` are equal.
- Returns `false` if either input is invalid or not in the ISO calendar.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `a` | `string` | year-month string |
| `b` | `string` | year-month string |

## Returns

`true` only when both are valid and name the same year and month, or `false` on invalid input

## Examples

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

areYearMonthsEqual("+002026-10", "2026-10") // true
```

## Source

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