days

Returns the number of days in the month: 28, 29, 30, or 31. Leap-year February returns 29.

import { Month } from "@teakit/month";

Month.from("2025-01").days(); // 31
Month.from("2025-04").days(); // 30
Month.from("2025-02").days(); // 28
Month.from("2024-02").days(); // 29

API Reference

Signature

month.days(): number;

Parameters

None.

Returns

Returns the day count of the month as a number.

Agent Contract

FieldValue
Kindinstance method
Canonical namedays
Mutates receiverNo
Returnsnumber
Related methodsquarter

Agent Notes

  • days() is month metadata — a pure function of the year-month, independent of any day anchor. It is not day-level arithmetic.
  • For the number of days between two months, use @teakit/day; @teakit/month does not do cross-month day arithmetic.