# subtractBusinessDays

Industry: Core

## Signature

```ts
subtractBusinessDays(value: string, amount: number, calendar?: BusinessCalendar): string
```

Return a PlainDate ISO string with `amount` working days subtracted from `value`.

- `calendar` names the weekend days and holidays to skip. Omit it and GMT keeps its original fixed Monday–Friday week with no holidays. Pass one anywhere the weekend is not Saturday–Sunday — much of the Middle East is Friday–Saturday.
- Negative `amount` behaves identically to `addBusinessDays(value, Math.abs(amount), cal)`.
- `amount` of 0 returns `value` unchanged — including when `value` is not itself a working day. Use `rollDate` to move a non-working day onto one.
- `value` is never counted, so subtracting 1 from a holiday lands on the working day before it.
- `value` and `calendar.holidays` are local dates; `calendar.timeZone` is not read. A caller holding an instant reduces it to a local date first, with `floorToZone`.
- Returns "" on invalid input — including a fractional `amount`, which names no whole number of working days — on an invalid `calendar`, and when the walk runs past 200,000 calendar days (about 547 years) without finishing.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | ISO PlainDate string |
| `amount` | `number` | whole number of working days to subtract; negative walks forwards |
| `calendar` | `BusinessCalendar` | optional BusinessCalendar; defaults to Monday–Friday with no holidays |

## Returns

ISO PlainDate string after subtracting working days, or "" on invalid input

## Related types

- [`BusinessCalendar`](/gmt/reference/types/BusinessCalendar/)

## Examples

```ts
import { subtractBusinessDays } from "@northguild/gmt/plain/calculate";

subtractBusinessDays("2024-03-18", 1) // "2024-03-15" (Monday back to Friday)
```

## Source

[plain/calculate/subtractBusinessDays.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/plain/calculate/subtractBusinessDays.ts)
