plainYearMonth
const plainYearMonth: RegExp = /^(?:\d{4}|\+\d{6}|-(?!0{6})\d{6})-(?:0[1-9]|1[0-2])$/;RegExp matching an ISO 8601 year-month in the extended form: YYYY-MM or ±YYYYYY-MM.
Examples
Section titled “Examples”import { plainYearMonth } from "@northguild/gmt";plainYearMonth.test("2026-10") // trueplainYearMonth.test("+275760-09") // trueplainYearMonth.test("+999999-12") // true (shape only; outside Temporal's range)plainYearMonth.test("202610") // false (basic format)plainYearMonth.test("2026-13") // false (month 13)plainYearMonth.test("2026-10-01") // false (a full date)Source
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.