# UK Working Days and Court Deadlines Calculator (`landlordtools/uk-working-days`) Actor

Add or count UK working days, check a date, find the next working day, list bank holidays for England and Wales, Scotland or Northern Ireland (official GOV.UK data), and work out court time limits with CPR 2.8 clear days.

- **URL**: https://apify.com/landlordtools/uk-working-days.md
- **Developed by:** [LandlordTools](https://apify.com/landlordtools) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 date results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

Date arithmetic is where people and AI assistants slip: "10 working days from 18 December" has to skip Christmas, the substitute Boxing Day and New Year's Day, and the answer differs in Scotland. This Actor uses the official GOV.UK bank holiday data for **England and Wales, Scotland and Northern Ireland** [1][2], and works out court time limits under **CPR 2.8** [3].

### What it does and who it is for

For finance teams, solicitors, landlords and AI agents. Send a list of date questions; get one answer row per question.

### Modes

| `mode` | Needs | Returns |
|---|---|---|
| `add-working-days` | `date`, `days` (negative goes back) | The date `days` working days away; the start date doesn't count |
| `working-days-between` | `date`, `to` | Working days after `date`, up to and including `to` |
| `is-working-day` | `date` | `isWorkingDay`, and the reason if not |
| `next-working-day`, `previous-working-day` | `date`, optional `orSame: true` | The nearest working day |
| `bank-holidays` | `date`, `to` | Bank holidays in that range |
| `cpr-days-before` | `date` (the event), `days` | Last day to act "at least `days` days before" |
| `cpr-days-after` | `date`, `days` | Earliest day for an event "at least `days` days after" |
| `cpr-within-days` | `date`, `days`, optional `courtOffice: true` | Last day to act "within `days` days" |

**CPR 2.8** [3]: periods expressed in days are clear days, so the day the period starts, and the day of the event that ends it, don't count. For periods of **5 days or less**, Saturdays, Sundays and bank holidays (including Christmas Day and Good Friday) don't count either. With `courtOffice`, a last day that falls when the court office is closed moves to the next day it's open (CPR 2.8(5)).

### Quick start

Prefill input:

```json
{
  "items": [
    {
      "label": "Invoice due in 10 working days",
      "mode": "add-working-days",
      "date": "2026-12-18",
      "days": 10
    },
    {
      "label": "Is Boxing Day substitute a working day?",
      "mode": "is-working-day",
      "date": "2026-12-28"
    },
    {
      "label": "Working days in April 2026",
      "mode": "working-days-between",
      "date": "2026-03-31",
      "to": "2026-04-30"
    },
    {
      "label": "Scotland: next working day after Hogmanay",
      "mode": "next-working-day",
      "date": "2026-12-31",
      "nation": "scotland"
    },
    {
      "label": "Serve application notice (3 clear days)",
      "mode": "cpr-days-before",
      "date": "2026-04-08",
      "days": 3
    },
    {
      "label": "Defence due (14 days, court office)",
      "mode": "cpr-within-days",
      "date": "2026-12-12",
      "days": 14,
      "courtOffice": true
    }
  ]
}
```

Six rows result, one per item. The first:

```json
{
  "index": 0,
  "label": "Invoice due in 10 working days",
  "mode": "add-working-days",
  "nation": "england-and-wales",
  "date": "2026-12-18",
  "days": 10,
  "result": "2027-01-06",
  "resultWeekday": "Wednesday",
  "error": null
}
```

Key values in the other five rows:

| index | Key values |
|---|---|
| 1 | `isWorkingDay: false`, `reason: "bank holiday: Boxing Day"` |
| 2 | `workingDays: 20` |
| 3 | `result: "2027-01-05"` (Scotland) |
| 4 | `result: "2026-03-31"`, with a `rule` sentence |
| 5 | `result: "2026-12-29"`, `courtOffice: true`, with a `rule` sentence |

Run on the bundled GOV.UK snapshot of 3 October 2026. OUTPUT adds `dataSource` and `sources`.

### Input fields

| Field | Type | Required | Default | Meaning |
|---|---|---|---|---|
| `items` | array of objects | yes | none | 1 to 5,000 calculations: `mode`, `date`, the fields in the Modes table, optional `nation` and `label` |
| `nation` | string | no | `england-and-wales` | Or `scotland`, `northern-ireland`; items can override. CPR modes always use England and Wales |
| `weekend` | array of integers | no | `[0, 6]` | Non-working weekday numbers, 0 Sunday to 6 Saturday. Not for CPR modes |
| `closures` | array of strings | no | none | Extra non-working dates, e.g. a Christmas shutdown, `YYYY-MM-DD`. Not for CPR modes |
| `useLiveData` | boolean | no | `true` | Read GOV.UK's live list at run time; the bundled copy is used if GOV.UK is unreachable |

### Output fields

| Field | Meaning |
|---|---|
| `index`, `label`, `mode`, `nation`, `date` | The item answered, with nation and date used |
| `days`, `to` | `days` and end date as given |
| `result`, `resultWeekday` | Answer date and its weekday (add, next, previous and CPR modes) |
| `workingDays`, `counting` | `working-days-between`: the count (negative if `to` is earlier) and how it is counted |
| `isWorkingDay`, `reason`, `weekday` | `is-working-day`: the answer, why not, and the weekday |
| `holidays` | `bank-holidays`: holidays in the range, with date, title and weekday |
| `rule`, `courtOffice` | CPR 2.8 rule applied, and whether CPR 2.8(5) was applied |
| `error` | `null` on success, otherwise why the item failed |

### Use from code

```bash
curl -X POST "https://api.apify.com/v2/acts/landlordtools~uk-working-days/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"mode": "add-working-days", "date": "2026-12-18", "days": 10}]}'
```

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('landlordtools/uk-working-days').call({
  items: [{ mode: 'add-working-days', date: '2026-12-18', days: 10 }],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].result);
```

### Use with AI agents

AI agents can call this Actor through Apify's MCP server (https://mcp.apify.com) instead of counting days themselves. Example prompt: "What is 10 working days after 18 December 2026 in England?"

### Limits

The live GOV.UK list [1] is read at run time, with the bundled copy as fallback. GOV.UK publishes bank holidays from 2019 to 2028. A calculation that reaches outside the published years returns an error, never a guess. Local holidays and court-specific closures aren't included: add them with `closures`, or check with the court. General information, not legal advice.

### Integrations

Power Platform, OpenAPI, Excel and Google Sheets files are in [`integrations/`](integrations/README.md). Apify's Zapier, Make and n8n apps work too.

### Pricing

Pay per event: $2 per 1,000 results, plus Apify's tiny per-run start fee ($0.00005). See the Pricing tab for the current price.

### Related Actors

- [UK Business Deadlines](https://apify.com/landlordtools/uk-business-deadlines): company and tax deadlines from a date.
- [UK Late Payment Interest](https://apify.com/landlordtools/uk-late-payment-interest): interest on a late business invoice.
- [UK Renters' Rights Dates](https://apify.com/landlordtools/uk-renters-rights-dates): rent increase and pet request dates.
- [England PRS Registration Deadline](https://apify.com/landlordtools/england-prs-registration-deadline): PRS registration dates.

### Sources

1. [GOV.UK: UK bank holidays (data feed for England and Wales, Scotland and Northern Ireland)](https://www.gov.uk/bank-holidays.json). Accessed 3 October 2026.
2. [GOV.UK: UK bank holidays](https://www.gov.uk/bank-holidays). Accessed 3 October 2026.
3. [Civil Procedure Rules, Part 2, rule 2.8: time](https://www.justice.gov.uk/courts/procedure-rules/civil/rules/part02). Accessed 3 October 2026.

[1]: https://www.gov.uk/bank-holidays.json

[2]: https://www.gov.uk/bank-holidays

[3]: https://www.justice.gov.uk/courts/procedure-rules/civil/rules/part02

# Actor input Schema

## `items` (type: `array`):

1 to 5000 objects, each with mode and date (YYYY-MM-DD) plus days or to, depending on the mode (see the README for the nine modes). Example: {"mode":"add-working-days","date":"2026-12-18","days":10}

## `nation` (type: `string`):

Bank holiday calendar for the whole run: england-and-wales (default), scotland or northern-ireland. An item can override it. CPR modes always use England and Wales.

## `weekend` (type: `array`):

Optional list of weekday numbers that are not working days, from 0 (Sunday) to 6 (Saturday). Default \[0, 6]. Example: \[5, 6]. Not used by CPR modes.

## `closures` (type: `array`):

Optional extra non-working dates such as a Christmas shutdown, each in YYYY-MM-DD format. Example: 2026-12-29. Not used by CPR modes.

## `useLiveData` (type: `boolean`):

true (default) reads the bank holiday list from GOV.UK at run time. false, or GOV.UK being unreachable, uses the copy bundled with the Actor.

## Actor input object example

```json
{
  "items": [
    {
      "label": "Invoice due in 10 working days",
      "mode": "add-working-days",
      "date": "2026-12-18",
      "days": 10
    },
    {
      "label": "Is Boxing Day substitute a working day?",
      "mode": "is-working-day",
      "date": "2026-12-28"
    },
    {
      "label": "Working days in April 2026",
      "mode": "working-days-between",
      "date": "2026-03-31",
      "to": "2026-04-30"
    },
    {
      "label": "Scotland: next working day after Hogmanay",
      "mode": "next-working-day",
      "date": "2026-12-31",
      "nation": "scotland"
    },
    {
      "label": "Serve application notice (3 clear days)",
      "mode": "cpr-days-before",
      "date": "2026-04-08",
      "days": 3
    },
    {
      "label": "Defence due (14 days, court office)",
      "mode": "cpr-within-days",
      "date": "2026-12-12",
      "days": 14,
      "courtOffice": true
    }
  ],
  "useLiveData": true
}
```

# Actor output Schema

## `result` (type: `string`):

No description

## `output` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "items": [
        {
            "label": "Invoice due in 10 working days",
            "mode": "add-working-days",
            "date": "2026-12-18",
            "days": 10
        },
        {
            "label": "Is Boxing Day substitute a working day?",
            "mode": "is-working-day",
            "date": "2026-12-28"
        },
        {
            "label": "Working days in April 2026",
            "mode": "working-days-between",
            "date": "2026-03-31",
            "to": "2026-04-30"
        },
        {
            "label": "Scotland: next working day after Hogmanay",
            "mode": "next-working-day",
            "date": "2026-12-31",
            "nation": "scotland"
        },
        {
            "label": "Serve application notice (3 clear days)",
            "mode": "cpr-days-before",
            "date": "2026-04-08",
            "days": 3
        },
        {
            "label": "Defence due (14 days, court office)",
            "mode": "cpr-within-days",
            "date": "2026-12-12",
            "days": 14,
            "courtOffice": true
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("landlordtools/uk-working-days").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "items": [
        {
            "label": "Invoice due in 10 working days",
            "mode": "add-working-days",
            "date": "2026-12-18",
            "days": 10,
        },
        {
            "label": "Is Boxing Day substitute a working day?",
            "mode": "is-working-day",
            "date": "2026-12-28",
        },
        {
            "label": "Working days in April 2026",
            "mode": "working-days-between",
            "date": "2026-03-31",
            "to": "2026-04-30",
        },
        {
            "label": "Scotland: next working day after Hogmanay",
            "mode": "next-working-day",
            "date": "2026-12-31",
            "nation": "scotland",
        },
        {
            "label": "Serve application notice (3 clear days)",
            "mode": "cpr-days-before",
            "date": "2026-04-08",
            "days": 3,
        },
        {
            "label": "Defence due (14 days, court office)",
            "mode": "cpr-within-days",
            "date": "2026-12-12",
            "days": 14,
            "courtOffice": True,
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("landlordtools/uk-working-days").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "items": [
    {
      "label": "Invoice due in 10 working days",
      "mode": "add-working-days",
      "date": "2026-12-18",
      "days": 10
    },
    {
      "label": "Is Boxing Day substitute a working day?",
      "mode": "is-working-day",
      "date": "2026-12-28"
    },
    {
      "label": "Working days in April 2026",
      "mode": "working-days-between",
      "date": "2026-03-31",
      "to": "2026-04-30"
    },
    {
      "label": "Scotland: next working day after Hogmanay",
      "mode": "next-working-day",
      "date": "2026-12-31",
      "nation": "scotland"
    },
    {
      "label": "Serve application notice (3 clear days)",
      "mode": "cpr-days-before",
      "date": "2026-04-08",
      "days": 3
    },
    {
      "label": "Defence due (14 days, court office)",
      "mode": "cpr-within-days",
      "date": "2026-12-12",
      "days": 14,
      "courtOffice": true
    }
  ]
}' |
apify call landlordtools/uk-working-days --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,landlordtools/uk-working-days"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/18KuSC7q2A5jS95hb/builds/STxCcJ5rcxAaVsvdx/openapi.json
