quarter

Returns the calendar quarter the month falls in, as the string "Q1", "Q2", "Q3", or "Q4".

import { Month } from "@teakit/month";

Month.from("2025-01").quarter(); // "Q1"
Month.from("2025-04").quarter(); // "Q2"
Month.from("2025-09").quarter(); // "Q3"
Month.from("2025-12").quarter(); // "Q4"

API Reference

Signature

month.quarter(): "Q1" | "Q2" | "Q3" | "Q4";

Parameters

None.

Returns

Returns the MonthQuarter string for the month: 0103"Q1", 0406"Q2", 0709"Q3", 1012"Q4".

Agent Contract

FieldValue
Kindinstance method
Canonical namequarter
Mutates receiverNo
ReturnsMonthQuarter ("Q1" | "Q2" | "Q3" | "Q4")
Related methodsdays

Agent Notes

  • quarter() is a pure function of the year-month; it is independent of any day anchor.
  • Use the returned string directly as a display label or grouping key — do not prepend "Q" yourself.