# ISO date observed shift

`iso-date-observed-shift` · version 1.0.0 · Dates & times (UTC, ISO 8601) · free, no key needed

Shift a date forward or backward until it lands on a day that is neither a weekend nor a caller-supplied holiday.

**Use when you need to: iso date observed shift · holiday observed date · move holiday off weekend.**

## Supported

- iso date observed shift
- holiday observed date
- move holiday off weekend

## Not supported

- built-in national holiday calendars
- nearest-day tie-break rules
- timezones

## Behavior

- date is a strict YYYY-MM-DD proleptic Gregorian UTC calendar date with year 0001-9999.
- weekend_days is an array of ISO weekday integers 1-7, unique, at most 6 entries (at least one non-weekend weekday must remain). holidays is an array of unique YYYY-MM-DD dates, at most 366 entries.
- direction is "forward" or "backward".
- If date is not in weekend_days and not listed in holidays, the result is date unchanged.
- Otherwise the date steps one calendar day at a time in the given direction until it lands on a day that is in neither weekend_days nor holidays.
- The call is rejected if a step would move outside year 0001-9999.

## Input

- `date` (string, required): min length 10; max length 10; pattern `^\d{4}-\d{2}-\d{2}$`
- `weekend_days` (array of integer, required): max items 6; each min 1; each max 7
- `holidays` (array of string, required): max items 366; each min length 10; each max length 10
- `direction` (one of "forward", "backward", required)

## Output

- `date` (string, required): min length 10; max length 10

## Limits

- year min: 1
- year max: 9999
- max weekend days: 6
- max holidays: 366

## Example

Request input:

```json
{
  "date": "2026-09-19",
  "weekend_days": [
    6,
    7
  ],
  "holidays": [],
  "direction": "forward"
}
```

Response:

```json
{
  "result": {
    "date": "2026-09-21"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "iso-date-observed-shift",
  "version": "1.0.0",
  "input": {
    "date": "2026-09-19",
    "weekend_days": [
      6,
      7
    ],
    "holidays": [],
    "direction": "forward"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/iso-date-observed-shift/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-09-19","weekend_days":[6,7],"holidays":[],"direction":"forward"}'
```

The machine-readable contract is at [/v1/tools/iso-date-observed-shift/versions/1.0.0](/v1/tools/iso-date-observed-shift/versions/1.0.0).

### CLI

```sh
node cli.mjs run iso-date-observed-shift 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [ISO date add months](/tools/iso-date-add-months): Add a signed month count to a YYYY-MM-DD date, clamping the day to the target month.
- [ISO date add years](/tools/iso-date-add-years): Add a signed whole-year delta to a YYYY-MM-DD date, clamping the day if 29 February has no match.
- [ISO date add](/tools/iso-date-add): Add a signed whole-day delta to a strict YYYY-MM-DD calendar date.
- [ISO date age](/tools/iso-date-age): Compute the calendar-aware elapsed years, months, and days between a birth date and an as-of date.
- [ISO date business day add](/tools/iso-date-business-day-add): Add a signed count of business days to a date, skipping caller-supplied weekend weekdays and holidays.
- [ISO date business days count](/tools/iso-date-business-days-count): Count the business days in an inclusive date range, skipping caller-supplied weekend weekdays and holidays.
