ne

Returns whether the receiver is a different month from another value. It is the logical opposite of eq. Day anchors are ignored.

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

Month.from("2025-01").ne("2025-02"); // true
Month.from("2025-01").ne("2025-01"); // false
Month.from("2025-01-31").ne("2025-01"); // false — anchor ignored

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

API Reference

Signatures

month.ne(other: MonthValue): boolean;
Month.ne(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 months are not equal; otherwise false.

Throws

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

Agent Contract

FieldValue
Kindinstance method and static helper
Canonical namene
AliasesNone
Mutates receiverNo
Returnsboolean
Orderingchronological
Related methodseq, cmp

Agent Notes

  • Use ne instead of !month.eq(...) when the not-equal intent should be explicit.
  • Day anchors never affect the result; only the year-month is compared.