gt

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

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

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

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

API Reference

Signatures

month.gt(other: MonthValue): boolean;
Month.gt(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 later; otherwise false.

Throws

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

Agent Contract

FieldValue
Kindinstance method and static helper
Canonical namegt
AliasesNone
Mutates receiverNo
Returnsboolean
Orderingchronological
Related methodsge, lt, cmp

Agent Notes

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