temporal-fns
API reference

endOfQuarter

API index · Input types and conventions · Installation

endOfQuarter(value) → same kind

Find the last date or final nanosecond of the containing quarter. For PlainYearMonth, return its quarter's last month.

import { endOfQuarter } from '@frantss/temporal-fns';

endOfQuarter(Temporal.PlainDate.from('2024-02-29')).toString(); // => '2024-03-31'
endOfQuarter(Temporal.PlainYearMonth.from('2026-10')).toString(); // => '2026-12'
endOfQuarter(Temporal.PlainDateTime.from('2026-05-17T14:30')).toString(); // => '2026-06-30T23:59:59.999999999'

Related: startOfQuarter, getQuarter, endOfYear.

Behaviors: BND-001: Plain date boundaries return complete dates; BND-002: Plain date-time boundaries retain nanosecond endpoint precision; BND-004: Month and quarter ends follow leap years and year boundaries; BND-005: Year-month boundaries return months rather than invent days.