min

Returns the earliest month among the given values. min is a static helper only.

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

Month.min("2025-03", "2025-01", "2025-02").toString(); // "2025-01"
Month.min("2024-12", "2025-01").toString(); // "2024-12"

API Reference

Signature

Month.min(...values: MonthValue[]): MonthInstance;

Parameters

ParameterTypeRequiredNotes
valuesMonthValue[]YesOne or more months to compare.

Returns

Returns a new Month equal to the earliest value.

Throws

  • Throws when called with no values.

Agent Contract

FieldValue
Kindstatic helper
Canonical namemin
Instance methodNo
Mutates receiverNo
ReturnsMonthInstance
Related methodsmax, clamp, cmp

Agent Notes

  • min is static only — there is no month.min(...).
  • To bound a single month into a range, use clamp instead.