isValidFiscalCalendar
Signature
Section titled “Signature”isValidFiscalCalendar(calendar: unknown): calendar is FiscalCalendarReturn true when calendar is a FiscalCalendar that getFiscalPeriod accepts.
patternmust be"4-5-4","4-4-5"or"5-4-4".yearEndsOnmust be a plain ISO date. A datetime or a date that does not exist is not.extraWeekmust be"firstPeriod"or"lastPeriod", andyearLabelmust be"startYear","endYear"or"majorityYear". Both are required: there is no default.- Extra properties are ignored.
- Returns
falsefor non-objects,nulland arrays. getFiscalPeriodreturns null for a calendar this rejects, the same sentinel it returns for an invalid date. Check the calendar here to tell the two apart.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
calendar | unknown | candidate value of any type |
Returns
Section titled “Returns”boolean indicating whether getFiscalPeriod accepts it
Related types
Section titled “Related types”Examples
Section titled “Examples”import { isValidFiscalCalendar } from "@northguild/gmt/calendar/validate";
isValidFiscalCalendar({ pattern: "4-5-4", yearEndsOn: "2026-01-31", extraWeek: "lastPeriod", yearLabel: "startYear" }) // trueSource
Section titled “Source”Accessibility
© 2026 NorthGuild · Licences
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.