Skip to content

areMonthDaysEqual

areMonthDaysEqual(a: string, b: string): boolean

Check whether two month-day strings (--MM-DD, or MM-DD) name the same day of the year.

  • Accepts both input forms, so 12-25 and --12-25 are equal.
  • The year is not part of a month-day: --02-29 is not equal to --02-28.
  • Returns false if either input is invalid or not in the ISO calendar.
ParameterTypeDescription
astringmonth-day string
bstringmonth-day string

true only when both are valid and name the same month and day, or false on invalid input

import { areMonthDaysEqual } from "@northguild/gmt/plain/compare";
areMonthDaysEqual("12-25", "--12-25") // true
output 

plain/compare/areMonthDaysEqual.ts

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.