Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Business Days Between

time.business_days_between

ProductionBounded custom (Class B)Deterministicstrictinstantv1.0.0
No network

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

Note
Counts business days between two local dates under a caller-declared weekend definition and an explicit holiday list.

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

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysismath

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input64 KB

How we handle your data

Sensitive input, safe output
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
startDatestringYesFirst named local date.
endDatestringYesSecond named local date.
weekendDaysarrayNoFrom 0 through 7 excluded weekdays; omit it for Saturday and Sunday.
holidaysarrayNoFrom 0 through the published holiday cap of explicit non-working dates; omit it for none.
inclusivestringNoEndpoint-counting rule; omit it for start.

Output schema

FieldTypeRequiredDescription
businessDaysintegerYesSigned working-day count.
calendarDaysintegerYesUnsigned counted calendar days.
weekendDaysInSpanintegerYesCounted weekend days.
holidayDaysintegerYesCounted non-weekend holidays.
inclusivestringYesApplied endpoint rule.
reversedbooleanYesWhether end precedes start.

API contract

POST /v1/execute
curl
curl -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"]}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
DATE_SPAN_TOO_LARGE429NoA size, quota, rate, or time limit was exceeded.
WEEKEND_DEFINITION_INVALID400NoThe request payload failed this skill's input validation.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "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

Inputjson
{
  "holidays": [
    "2026-03-05"
  ],
  "startDate": "2026-03-02",
  "endDate": "2026-03-13"
}
Expected outputjson
{
  "inclusive": "start",
  "calendarDays": 11,
  "reversed": false,
  "businessDays": 8,
  "weekendDaysInSpan": 2,
  "holidayDays": 1
}
Tip
Half-open by default: the start date counts and the end date does not

A reversed range gives a signed answer

Inputjson
{
  "startDate": "2026-03-13",
  "endDate": "2026-03-02",
  "inclusive": "neither"
}
Expected outputjson
{
  "inclusive": "neither",
  "calendarDays": 10,
  "reversed": true,
  "businessDays": -8,
  "weekendDaysInSpan": 2,
  "holidayDays": 0
}
Tip
Reversing the arguments negates the count, which is what a signed delta needs
  • 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

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.

Tags

analysisdate-timemath