Business Days Between
time.business_days_between
Overview
Counts business days between two ISO local dates. The weekend is whatever the caller declares (Saturday and Sunday by default, or any set from none to six days) and holidays are supplied explicitly as a list of dates — no national calendar is bundled, so an empty holidays array means weekends only. Inclusivity is explicit: 'start' (default) counts a half-open range, and 'both', 'end', and 'neither' are also available. A reversed range returns a negative count rather than an error. Holidays falling on a weekend are never counted twice.
Working-day counting depends on conventions you must declare — we make weekend days, holidays, inclusivity, and reversed ranges explicit instead of assumed.
Reliability
Same dates, same rules, same count — we read no clock, no locale and no zone data, and we bundle no national holidays, so a working calendar is only ever what you send. A holiday listed twice, or listed on a weekend day, affects the result exactly once, or not at all. Whole weeks are computed arithmetically, so a hundred-year span costs the same as a two-week one. DATE_SPAN_TOO_LARGE — trigger: startDate and endDate are more than 36500 days apart, about a century, in either direction; retryable: no, the same pair always fails; next: check for a typo in the year, or split the span into shorter windows and add the counts. WEEKEND_DEFINITION_INVALID — trigger: weekendDays names all seven days, which leaves no working day to count; retryable: no; next: leave at least one day out of the weekend list, or send an empty array if every day is a working day.
Context footprint
One call replaces a day-by-day loop an agent would otherwise simulate token by token, and returns six scalar fields. A successful call costs 1 execution credit.
When to use it
When you measure an SLA, payment term, or project duration in working days and you supply the calendar rules.
Do not use for calendar-day differences, hour-level scheduling, or when you need the platform to know a country's public holidays.
Scope
Non-goals
- Does not bundle national or regional holiday calendars — holidays are supplied
- Does not do partial-day or working-hour arithmetic
- Does not handle time zones; both dates are plain local dates
- Does not apply month-end or quarter-end financial conventions
- Does not read the system clock
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| startDate | string | Yes | First named local date. |
| endDate | string | Yes | Second named local date. |
| weekendDays | array | No | From 0 through 7 excluded weekdays; omit it for Saturday and Sunday. |
| holidays | array | No | From 0 through the published holiday cap of explicit non-working dates; omit it for none. |
| inclusive | string | No | Endpoint-counting rule; omit it for start. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| businessDays | integer | Yes | Signed working-day count. |
| calendarDays | integer | Yes | Unsigned counted calendar days. |
| weekendDaysInSpan | integer | Yes | Counted weekend days. |
| holidayDays | integer | Yes | Counted non-weekend holidays. |
| inclusive | string | Yes | Applied endpoint rule. |
| reversed | boolean | Yes | Whether end precedes start. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"time.business_days_between","input":{"startDate":"2026-03-02","endDate":"2026-03-13","holidays":["2026-03-05"]}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("time.business_days_between", {"holidays":["2026-03-05"],"startDate":"2026-03-02","endDate":"2026-03-13"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| DATE_SPAN_TOO_LARGE | 429 | No | A size, quota, rate, or time limit was exceeded. |
| WEEKEND_DEFINITION_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not bundle national or regional holiday calendars — holidays are supplied
- Does not do partial-day or working-hour arithmetic
- Does not handle time zones; both dates are plain local dates
- Does not apply month-end or quarter-end financial conventions
- Does not read the system clock
- Counting calendar days (plain date subtraction does that)
- Anything that needs a built-in public-holiday calendar
- Hour-level or shift-level working-time calculations
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "time.business_days_between",
"input": {
"holidays": [
"2026-03-05"
],
"startDate": "2026-03-02",
"endDate": "2026-03-13"
}
}Examples
Count working days across a holiday
{
"holidays": [
"2026-03-05"
],
"startDate": "2026-03-02",
"endDate": "2026-03-13"
}{
"inclusive": "start",
"calendarDays": 11,
"reversed": false,
"businessDays": 8,
"weekendDaysInSpan": 2,
"holidayDays": 1
}A reversed range gives a signed answer
{
"startDate": "2026-03-13",
"endDate": "2026-03-02",
"inclusive": "neither"
}{
"inclusive": "neither",
"calendarDays": 10,
"reversed": true,
"businessDays": -8,
"weekendDaysInSpan": 2,
"holidayDays": 0
}Recommended use cases
- Measure an SLA in working days between a ticket opening and its resolution
- Compute payment terms that are expressed in business days
- Report how many working days a project phase actually consumed
Avoid for
- Counting calendar days (plain date subtraction does that)
- Anything that needs a built-in public-holiday calendar
- Hour-level or shift-level working-time calculations
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.