Skip to content

getQuarterForDate

  • The core functions, which every industry uses.
getQuarterForDate(value: string): number | null

Return the quarter of the year (1-4) for a given ISO date.

  • Returns the quarter (1-4) containing the input date.
  • Q1 = months 1-3, Q2 = months 4-6, Q3 = months 7-9, Q4 = months 10-12.
  • Validates input using isValidDate.
ParameterTypeDescription
valuestringISO PlainDate string

number (1-4) or null for invalid input

import { getQuarterForDate } from "@northguild/gmt/plain/calculate";
getQuarterForDate("2024-01-15") // 1
output 

plain/calculate/getQuarterForDate.ts

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.