Date Module
Date math, formatting, time-zone conversion, business-day calendars, SLA deadlines, and locale-aware humanization.
Workflow Engine V 1.0.0Description
What this does
The Date module is a pure-utility companion to the Standard and Scheduler modules. It adds the missing date primitives so workflow authors can do calendar reasoning without writing JavaScript.
Read / construct
- Now, ParseDate, BuildDate — get a canonical ISO-8601 UTC value from the wall clock, a free-form string, or individual components.
Format / convert
- FormatDate — render a datetime as a user-facing string (locale + time zone aware).
- ConvertTimeZone — UTC ↔ IANA / Windows zones.
- ExtractDatePart — Year, Month, Day, Hour, Minute, Weekday number / name (localized), Quarter, ISO week, day-of-year.
Arithmetic
- AddDuration, SubtractDuration — calendar-aware shifts (Months / Years use AddMonths / AddYears).
- DateDiff — signed or absolute difference in any unit, with configurable precision.
- RoundDate — nearest N seconds / minutes / hours / days (up / down / nearest).
- StartOf, EndOf — boundary of day / week / month / quarter / year, time-zone aware.
Branching gateways (route via TaskOutput)
- CompareDates — before / equal / after / within (with tolerance).
- IsExpired — valid / expired given a reference + TTL.
- IsWithinSchedule — inside / outside a recurring weekly window + holiday list. The most-used pattern for business-hours routing of inbound calls and messages.
Business calendar
- IsBusinessDay — business / weekend / holiday.
- AddBusinessDays, NextBusinessDay — skip weekends + holidays during the walk.
- SLADeadline — start + SLA → deadline, plus met / breached routing.
Humanize (locale-aware)
- HumanizeDuration — '2 hours 5 minutes', '2 ore e 5 minuti'.
- RelativeTimePhrase — 'in 3 days', 'tra 3 giorni', '5 minutes ago', '5 minuti fa'.
- AgeInUnits — birthday / signup → integer age.
Validation
- DateValidationGuard — gateway: valid / invalid / outOfRange, with parsed-value writeback on success.
Input & time conventions
- All times use the 24-hour clock — type '17:00', not '5:00 PM'.
- Date inputs accept ISO-8601 ('2026-03-25T10:00:00Z'), unix seconds or milliseconds, RFC 1123, or a locale-formatted string (set Locale), plus
{variable}placeholders. - Locale falls back: the task's
Localefield → the conversation language → the module'sDefault locale→en-US. - Weekend and holiday day names are always English ('Saturday,Sunday'), regardless of locale.
Locale support
Built-in dictionaries: en, it, fr, es, de (plus invariant for unknown cultures). Every task with user-visible output accepts a Locale override and otherwise falls back to:
- The running execution's
UserLanguage(set byStandardModule.LanguageTask). - The module's
DefaultLocalesetting. en-US.
See the setup guide for configuration and full task reference.