areYearMonthsEqual
Signature
Section titled “Signature”areYearMonthsEqual(a: string, b: string): booleanCheck whether two year-month strings (YYYY-MM) name the same year and month.
- Accepts both year forms, so
2026-10and+002026-10are equal. - Returns
falseif either input is invalid or not in the ISO calendar.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
a | string | year-month string |
b | string | year-month string |
Returns
Section titled “Returns”true only when both are valid and name the same year and month, or false on invalid input
Examples
Section titled “Examples”import { areYearMonthsEqual } from "@northguild/gmt/plain/compare";
areYearMonthsEqual("+002026-10", "2026-10") // trueSource
Section titled “Source”Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else:© 2026 NorthGuild, all rights reserved.