lt

Returns whether the receiver is strictly earlier than another month. Comparison uses the month index only.

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

Month.from("2025-01").lt("2025-02"); // true
Month.from("2025-01").lt("2025-01"); // false
Month.from("2025-02").lt("2025-01"); // false

Month.lt("2025-01", "2025-02"); // true

API Reference

Signatures

month.lt(other: MonthValue): boolean;
Month.lt(left: MonthValue, right: MonthValue): boolean;

Parameters

ParameterTypeRequiredNotes
otherMonthValueInstance onlyMonth compared against the receiver.
leftMonthValueStatic onlyLeft-hand month.
rightMonthValueStatic onlyRight-hand month.

Returns

Returns true when the left month is strictly earlier; otherwise false.

Throws

  • Throws when an input value is not a valid month.

Agent Contract

FieldValue
Kindinstance method and static helper
Canonical namelt
AliasesNone
Mutates receiverNo
Returnsboolean
Orderingchronological
Related methodsle, gt, cmp

Agent Notes

  • Use comparison methods instead of relational operators on Month values.
  • Use le when equality should also count as "earlier or equal".