API reference
isSameQuarter
API index · Input types and conventions · Installation
isSameQuarter(value, base, options?) → boolean
Check whether values fall in the same three-month ISO quarter of the same year. Accepts PlainYearMonth, but not PlainMonthDay because equality needs a year.
import { isSameQuarter } from '@frantss/temporal-fns';
isSameQuarter(Temporal.PlainYearMonth.from('2026-10'), Temporal.PlainYearMonth.from('2026-12')); // => true
isSameQuarter(Temporal.PlainDate.from('2026-09-30'), Temporal.PlainDate.from('2026-10-01')); // => false
isSameQuarter(Temporal.PlainDate.from('2025-10-23'), Temporal.PlainDate.from('2026-10-23')); // => falseRelated: getQuarter, startOfQuarter, isSameMonth.
Behaviors: CMP-001: Period equality checks the period and its year; CMP-002: Plain date-time comparisons ignore clocks; CMP-006: Partial months compare only at their supported precision.