max

Returns the latest month among the given values. max is a static helper only.

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

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

API Reference

Signature

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

Parameters

ParameterTypeRequiredNotes
valuesMonthValue[]YesOne or more months to compare.

Returns

Returns a new Month equal to the latest value.

Throws

  • Throws when called with no values.

Agent Contract

FieldValue
Kindstatic helper
Canonical namemax
Instance methodNo
Mutates receiverNo
ReturnsMonthInstance
Related methodsmin, clamp, cmp

Agent Notes

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