@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
15 lines • 674 B
TypeScript
/**
* Check whether two year-month strings (`YYYY-MM`) name the same year and month.
*
* - Accepts both year forms, so `2026-10` and `+002026-10` are equal.
* - Returns `false` if either input is invalid or not in the ISO calendar.
*
* @param a year-month string
* @param b year-month string
* @returns `true` only when both are valid and name the same year and month, or `false` on invalid input
*
* @example areYearMonthsEqual("+002026-10", "2026-10") // true
* @example areYearMonthsEqual("2026-10", "2025-10") // false
* @example areYearMonthsEqual("2026-13", "2026-13") // false
*/
export declare function areYearMonthsEqual(a: string, b: string): boolean;