Skip to content

month

const month: RegExp = /^(0[1-9]|1[0-2])$/;

RegExp matching an ISO 8601 month: 01–12.

import { month } from "@northguild/gmt";
month.test("01") // true
month.test("12") // true
month.test("13") // false (out of range)
month.test("1") // false (not zero-padded)

regex/date.ts