DAP Foundry dap.solutions
add-business-days-to-date · page and endpoint · v1

Add business days to date

Give a start date and a number of business days. Get the business day the count lands on, on the Payments Canada calendar, with every closure day it passed. On this page it runs in this tab, and your inputs stay in it.

Input

One JSON object with five named inputs, each given once, up to 4,096 bytes. It is the same body the endpoint takes.

inputwhat it is
start_dateA real calendar date written YYYY-MM-DD, such as 2026-10-09, in a year the calendar covers. It may be a weekend or a closure day.
business_daysBusiness days to move forward, 0 to 260, as a string or a whole number.
calendarca-payments-canada, the one calendar this tool has.
acknowledgeno-ruling-v1, exactly. This tool calculates. It does not issue rulings.
freshness_toleranceHow old the holiday calendar may be, in whole days written like P7D, no more than the ceiling a person set for this tool. Every answer states that ceiling as ratified_ceiling.

Output

An envelope in JSON with these fields, in this order: tool, artifact_hash, status, refusal, result, inputs, provenance, ratified_ceiling, declared_tolerance, acknowledgment, disclaimer, attestation_badge, retention.

A computed call gives a result with these fields, in this order: date, the business day the count lands on; weekday, its weekday; calendar_days, the days from the start date to it; start_is_business_day; start_weekday; start_closure, the closure's name when the start date is a closure day, otherwise null; and closures_passed, every closure day after the start date and before date, in date order, each with its date and name. A refused call gives a code and a message, and nothing was computed. artifact_hash names the artifact that answered, and provenance states the calendar and its age in whole days, or null when the clock reads earlier than the time the calendar was collected.

The count

A business day is a weekday that is not a system closure day on the calendar. With business_days of 1 or more, start at start_date and move forward one business day at a time, that many times. The start date itself is never counted, whether or not it is a business day. With business_days of 0, a start date that is a business day stays where it is, and any other start date moves forward to the next business day. So 0 answers two questions at once: is this date a business day, and if not, which is the next one.

The calendar

Payments Canada system closure schedule, from https://www.payments.ca/system-closure-schedule, collected at 2026-11-04T11:47:58Z. It covers 2026 to 2027, the two years the source publishes. Saturdays, Sundays and the 20 closure days it lists, 10 in each year, are not business days. A start date outside 2026 and 2027 is refused, and so is a count that runs past 2027-12-31. Neither is ever guessed.

The calendar is bound into this artifact. Refreshing it is a new artifact and a new Clear by a person, never an update in place. Every answer states the calendar's age: whole days from the time it was collected to the clock this tool reads, or null when that clock reads earlier than that time. On this page that is this device's clock, so a wrong clock gives a wrong age and a wrong staleness check. The endpoint uses the server's clock. A call made while the clock reads earlier than the collection time computes nothing. A call whose tolerance is less than the calendar's age is refused as INPUT_STALE, so once the calendar is older than the ceiling no call computes until the calendar is collected again and a person Clears the new artifact.

Refusals

The checks run in a fixed order, and the first that fails is the answer: the request can be read; acknowledge; freshness_tolerance present, well formed, at or under the ceiling; no unknown or repeated input; calendar; the clock and the calendar's age; start_date; business_days; coverage of the start date; coverage of the count. On this page every refusal shows its code (listed in the table below), the field and rule it concerns, the message, and a valid example. The endpoint returns the code and a message that says what failed and, where a different request could succeed, what to send.

codewhen
INPUT_INVALIDThe request cannot be read or is over 4,096 bytes, or an input is unknown, repeated, missing or not valid.
ACK_MISSINGacknowledge is not no-ruling-v1.
TOLERANCE_MISSINGfreshness_tolerance is absent, null or empty.
TOLERANCE_INVALIDfreshness_tolerance is not whole days written like P7D.
TOLERANCE_OVER_CEILINGThe tolerance is above the ceiling a person set for this tool, or no ceiling is set yet.
CLOCK_BEHINDThe clock this tool read is earlier than the time the calendar was collected, even by 1 millisecond, so its age cannot be known.
INPUT_STALEThe calendar is older than the declared tolerance.
OUT_OF_COVERAGEThe start date, the date the count lands on, or a day walked between them falls outside the years the calendar covers.

The endpoint

The same core answers at https://foundry.dap.solutions/api/add-business-days-to-date, by GET with query parameters or by POST with this JSON body: 200 when computed, 422 when refused. Prefer POST, because GET puts your inputs in the URL, where proxies and logs outside this tool may record them. A POST keeps them in the body. This page is free. What the endpoint costs, and how an agent pays, is stated at https://dap.solutions/agents/ and in /llms.txt.

Your inputs are not stored

On this page your inputs stay in this browser. The endpoint reads each request in memory and keeps no copy of your inputs. This tool sets no cookie and uses no browser storage.