temporal-fns
API reference

subBusinessDays

API index · Input types and conventions · Installation

subBusinessDays(value, amount, options?) → same kind

Move backward by amount working dates, with the same rules as addBusinessDays. A negative amount moves forward. Amounts must be safe integers; zero returns the original object after validating configuration.

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

const monday = Temporal.PlainDate.from('2026-10-26');
subBusinessDays(monday, 1).toString(); // => '2026-10-23'
subBusinessDays(monday, -1).toString(); // => '2026-10-27'
subBusinessDays(monday, 0) === monday; // => true
subBusinessDays(monday, 1, { weekendDays: [] }).toString(); // => '2026-10-25'

Related: addBusinessDays, differenceInBusinessDays, previousDay.

Behaviors: BUS-001: Business-day addition counts dates reached after moving; BUS-002: Zero preserves the original object even on a weekend; BUS-003: Configurable weekends affect arithmetic and are independent of week starts; BUS-009: Entirely skipped dates are never counted as working dates; BUS-015: Business-day amounts cannot lose integer precision.