Business-day arithmetic with a caller-supplied weekend mask and holiday list
time_business-daysBusiness-day arithmetic with a caller-supplied calendar: add or subtract N working days from a date, or count the working days between two dates. The weekend is specified as a weekday mask so Friday-Saturday and Sunday-only weeks work, and holidays are passed in as an explicit date list, so the answer never depends on a holiday table that can go stale. Returns the result date, the day count, and the first 1,000 skipped dates with the reason each was skipped. Price: $0.05 per successful call, paid over x402 (USDC on Base).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | add (default) N business days to from, or count business days between from and to. Accepted: add, count. | |
| to | No | End date YYYY-MM-DD, may precede from. Required when op=count. Accepted: a calendar date as YYYY-MM-DD. | |
| days | No | Business days to add, -3650 to 3650. Required when op=add. Accepted: integer between -3650 and 3650. | |
| from | Yes | Start date, YYYY-MM-DD. Accepted: a calendar date as YYYY-MM-DD. | |
| weekend | No | Comma-separated weekday names or ISO numbers. Default sat,sun. Empty string = no weekend. Accepted: comma-separated weekday names (mon..sun) or ISO numbers 1-7. | |
| holidays | No | Comma-separated YYYY-MM-DD holiday dates. Accepted: comma-separated YYYY-MM-DD dates, at most 2048 characters. | |
| inclusive | No | For op=count: start (default, half-open [from, to)), both or neither. Accepted: start, both, neither. |