# getDaysInYearMonth

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

## Signature

```ts
getDaysInYearMonth(value: string): number | null
```

Return the number of days in a year-month.

- 28–31 depending on the month; February varies by leap year.
- The two limit months, `-271821-04` and `+275760-09`, have 30 days, though Temporal holds only part of each.
- Returns null on invalid input.

## Parameters

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

## Returns

number of days in the month (28-31), or null on invalid input

## Examples

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

getDaysInYearMonth("2024-02") // 29 (leap year)
```

## Source

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