Workflow action

Dates & business calendar

ut_dates

Business days around holidays, SLA due times in working hours across time zones and DST, durations and ages, recurring schedules and fiscal periods.

Officialv1.0.06 functions Pure computation

About

What it does

Dates & business calendar handles the date rules that decide deadlines. Add or subtract business days around weekends and your holiday list, and compute an SLA due time from a start moment and a number of working hours: only working hours on working days count, in the time zone of the team, with daylight-saving changes handled because working hours are wall-clock times. The result comes back as a UTC instant and as local time with its offset.

It also measures durations (calendar days, business days, hours, a readable "2 years, 3 months" text and an exact age), converts a moment between time zones, lists the next occurrences of a schedule such as "the last Friday of every month at 16:00 London time", and finds the fiscal year, quarter and period of a date for a fiscal year that starts in any month, with the period, quarter and year boundaries and a label like FY2027 Q2.

Good for

  • Set a due date 8 working hours after a ticket arrives, in the support team's time zone
  • Pay an invoice 10 business days after approval, skipping public holidays
  • Tag records with the fiscal year and quarter for reporting

After installing

  1. Install the package: the action appears in Extensibility → Workflow actions and in the workflow designer's palette under Custom actions.
  2. Drag Dates & business calendar onto a workflow, choose the function and map its inputs; keep holidays in a data table or variable and map the list into Holidays.
  3. Use the outputs from the data picker, e.g. {{sla_due}} for a Set SLA or Pause Until step, or {{fiscal_label}} in a title.
  4. Try the included "Business-hours SLA (sample)" workflow from the API or its start form: it computes a due time in Pacific/Auckland working hours and the business days until then.

Examples

Real inputs, real outputs

Each example ran in the sandbox when this gallery was built; the outputs are exactly what the step returns.

8 working hours from Friday afternoon sla_due

1.5 hours on Friday, the rest on Monday.

Inputs

{
  "start": "2026-11-06T15:30:00",
  "hours": 8,
  "working_hours": "09:00-17:00",
  "time_zone": "Pacific/Auckland"
}

Outputs

{
  "due": "2026-11-09T02:30:00.000Z",
  "due_local": "2026-11-09T15:30:00+13:00",
  "due_date": "2026-11-09",
  "start_local": "2026-11-06T15:30:00+13:00",
  "calendar_hours": 72
}

3 business days over Christmas add_business_days

Inputs

{
  "date": "2026-12-23",
  "days": 3,
  "holidays": [
    "2026-12-25",
    "2026-12-28",
    "2027-01-01"
  ]
}

Outputs

{
  "date": "2026-12-30",
  "weekday": "Wednesday",
  "calendar_days": 7
}

Fiscal quarter (year from July) fiscal_period

Inputs

{
  "date": "2026-11-01",
  "start_month": 7
}

Outputs

{
  "fiscal_year": 2027,
  "quarter": 2,
  "period": 5,
  "label": "FY2027 Q2",
  "period_label": "FY2027 P05",
  "period_start": "2026-11-01",
  "period_end": "2026-11-30",
  "quarter_start": "2026-10-01",
  "quarter_end": "2026-12-31",
  "year_start": "2026-07-01",
  "year_end": "2027-06-30",
  "day_of_year": 124
}

Last Friday of the month at 16:00 London next_occurrence

Inputs

{
  "frequency": "monthly",
  "nth_week": "last",
  "weekday": "Friday",
  "time": "16:00",
  "time_zone": "Europe/London",
  "after": "2026-11-01T00:00:00Z",
  "count": 3
}

Outputs

{
  "next": "2026-11-27T16:00:00.000Z",
  "next_local": "2026-11-27T16:00:00+00:00",
  "occurrences": [
    "2026-11-27T16:00:00.000Z",
    "2026-12-25T16:00:00.000Z",
    "2027-01-29T16:00:00.000Z"
  ],
  "occurrences_local": [
    "2026-11-27T16:00:00+00:00",
    "2026-12-25T16:00:00+00:00",
    "2027-01-29T16:00:00+00:00"
  ]
}

Age on a date duration

Inputs

{
  "from": "1990-07-15",
  "to": "2026-11-01"
}

Outputs

{
  "days": 13258,
  "business_days": 9470,
  "hours": 318192,
  "minutes": 19091520,
  "human": "36 years, 3 months, 17 days",
  "age_years": 36,
  "age_months": 3,
  "age_days": 17
}

Reference

Functions, inputs and outputs

The designer generates each function's input panel from these declarations; outputs appear in the data picker with their types.

Add business days add_business_days

Add (or with a negative number, subtract) business days to a date, skipping weekends and holidays. Adding 0 returns the date itself, or the next business day when it falls on a weekend or holiday.

Inputs

  • date date · required — The starting date (YYYY-MM-DD).
  • days integer · required — How many business days to add; negative to go back.
  • weekend_days list of strings — Days that are not business days (names such as Saturday, or ISO numbers 1 = Monday … 7 = Sunday).
  • holidays list of strings — Dates that are not business days, as YYYY-MM-DD (a list, or one per line).

Outputs

  • date date — The resulting business day.
  • weekday string — Monday … Sunday.
  • calendar_days integer — Calendar days between the start and the result (negative when going back).

SLA due time sla_due

The moment a number of working hours after a start time runs out, counting only working hours on working days in a time zone and skipping holidays. Daylight-saving changes are handled: working hours are wall-clock times.

Inputs

  • start date & time · required — When the clock starts (ISO 8601). Without Z or an offset it is local time in Time zone.
  • hours number · required — The SLA in working hours (decimals allowed, e.g. 0.5).
  • working_hours string — Start and end of the working day, e.g. 09:00-17:00 (use 00:00-24:00 for round the clock).
  • working_days list of strings — Weekdays that have working hours (names or ISO numbers 1–7).
  • time_zone string — IANA time zone of the working hours and holidays.
  • holidays list of strings — Dates that are not business days, as YYYY-MM-DD (a list, or one per line).

Outputs

  • due date & time — The due moment as an ISO 8601 UTC instant.
  • due_local string — The due moment in the time zone, with its offset, e.g. 2026-11-09T14:30:00+13:00.
  • due_date date
  • start_local string — The start in the time zone, with its offset.
  • calendar_hours number — Elapsed real time from start to due, in hours.

Duration / age duration

The time between two dates or date-times: calendar days, business days, hours and minutes, a readable text and the age in years, months and days. Negative when To is before From.

Inputs

  • from date & time · required — Date (YYYY-MM-DD) or date-time.
  • to date & time — Date or date-time; empty for now.
  • time_zone string — Time zone for dates and times without an offset, and for counting calendar days.
  • weekend_days list of strings — Days that are not business days (names such as Saturday, or ISO numbers 1 = Monday … 7 = Sunday).
  • holidays list of strings — Dates that are not business days, as YYYY-MM-DD (a list, or one per line).

Outputs

  • days integer — Whole calendar days.
  • business_days integer — Business days after From up to and including To.
  • hours number — Elapsed hours (2 decimals).
  • minutes integer — Elapsed whole minutes.
  • human string — For example "36 years, 3 months, 17 days" or "2 hours, 15 minutes".
  • age_years integer — Whole years (age).
  • age_months integer — Months after the whole years.
  • age_days integer — Days after the whole months.

Convert time zone convert_timezone

Show a moment in another time zone: the UTC instant, the local date-time with its offset, date, time and weekday.

Inputs

  • datetime date & time · required — ISO 8601. Without Z or an offset it is read in From zone.
  • from_zone string — IANA time zone of a date-time without an offset.
  • to_zone string · required — IANA time zone to show the moment in.

Outputs

  • iso date & time
  • local string — With its offset, e.g. 2026-11-03T03:00:00+13:00.
  • local_date date
  • local_time string — HH:mm.
  • weekday string
  • offset string — For example +13:00.
  • offset_minutes integer

Next occurrences next_occurrence

The next dates of a recurring schedule: daily, weekly on chosen days, monthly on a day of the month or the nth weekday (e.g. last Friday), or yearly, every N periods, at a time of day in a time zone.

Inputs

  • frequency choice · daily / weekly / monthly / yearly — How often it repeats.
  • interval integer — Repeat every N days / weeks / months / years.
  • days_of_week list of strings — Weekly: the days (names or ISO numbers); default the weekday of Start.
  • day_of_month integer — Monthly / yearly: 1–31 (later than the month has = its last day) or -1 for the last day; default the day of Start.
  • nth_week choice · none / first / second / third / fourth / last — Monthly / yearly: instead of a day of the month, the first … fourth or last Weekday.
  • weekday string — With Nth weekday: Monday … Sunday.
  • month integer — Yearly: 1–12; default the month of Start.
  • time string — Local time of each occurrence (HH:mm).
  • time_zone string — IANA time zone of the schedule.
  • after date & time — List occurrences after this moment; empty for now.
  • start date — First possible date of the schedule (the anchor for Every N); default the date of After.
  • count integer — Number of occurrences to return (1–100).
  • exclude_dates list of strings — Dates (YYYY-MM-DD) to leave out, e.g. holidays.

Outputs

  • next date & time — The next occurrence (UTC instant); empty when none was found.
  • next_local string — With its offset.
  • occurrences list of datetimes — UTC instants, in order.
  • occurrences_local list of strings — Local date-times with offsets.

Fiscal period fiscal_period

The fiscal year, quarter and period (month) of a date for a fiscal year starting in any month, with the start and end dates of the period, quarter and year and a label such as FY2027 Q2.

Inputs

  • date date — The date; empty for today (in Time zone).
  • start_month integer — 1 = January … 12 = December, e.g. 7 for July (Australia, NZ public sector), 4 for April (UK, India, Japan, Canada).
  • year_naming choice · end / start — The calendar year in which the fiscal year ends (FY2027 = July 2026–June 2027) or starts.
  • time_zone string — For "today" when Date is empty.

Outputs

  • fiscal_year integer
  • quarter integer — 1–4.
  • period integer — Month of the fiscal year, 1–12.
  • label string — For example FY2027 Q2.
  • period_label string — For example FY2027 P05.
  • period_start date
  • period_end date
  • quarter_start date
  • quarter_end date
  • year_start date
  • year_end date
  • day_of_year integer — 1 on the first day.

Network

None. The action cannot make requests.

Data and files

None. It only sees its inputs.

Secrets

None.

Install

Install it in your workspace

Works on UserTasks cloud and any self-hosted instance. The action lands in Extensibility → Workflow actions, enabled, with its sample workflow.

In the app

  1. Open Extensibility → Workflow actions → Browse gallery and choose Install on Dates & business calendar. Or download workflow-action-date-business-calendar-1.0.0.utpkg and drag it onto Automations → Packages.
  2. The wizard verifies the checksum, every file hash and the signature, and shows what it adds.
  3. In the workflow designer, drag Dates & business calendar from Custom actions, pick a function and fill its inputs. Save & Test shows the typed outputs.

With the CLI

shell
curl -fLO https://usertasks.com/gallery/workflow-action-date-business-calendar-1.0.0.utpkg
usertasks packages install workflow-action-date-business-calendar-1.0.0.utpkg
usertasks activities test ut_dates -f '{"operation":"add_business_days"}'

Verify the download

File SHA-256
206af8a9bafad301cb1f7cd44235430faab2c81396781ba882fd39ed1ec7a515
Package checksum (what is signed)
sha256:879a4cff578eaa6224a34bf76295c4a406f3097f7a9092fe070d6cb7ec405076
Module SHA-256
99a445fcad96eea94723b1140ccadb368b110fb7f7eed64dedd88e80a488b177
Signer
UserTasks Gallery · 49:f3:04:90:47:02:4d:07:28:61:3d:dc:bb:aa:db:11

More workflow actions

All actions