Previous working day
Return the last working day before a date in a business calendar, or the date itself when it is a working day and same_day is on. The time of day is kept.
Command in the Date and time toolkit · id ooa.datetime/previous_working_day · 6 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Value | DateTime | Yes | Date to start from. | |
| Calendar | String | No | Name of a holiday calendar in One CommandCenter (its holidays and weekend). Read once per run as the run's user; needs the agent to run from One CommandCenter. Leave empty to give the holidays and weekend here. | |
| Holidays | List | No | Dates that are not working days, as yyyy-MM-dd, e.g. ["2026-12-25"]. Added to the calendar's dates when a calendar is named too. | |
| Weekend | String | No | Days of the week that are not working days, e.g. SAT,SUN (the default) or FRI,SAT; NONE when every day is a working day. When given with a calendar, it replaces the calendar's weekend. | |
| Same day | Boolean | No | false | Return the date itself when it is a working day. |
| Time zone | String | No | UTC | Time zone whose calendar date counts; the time of day is kept in this zone. |
Outputs
| Output | Type | What it is |
|---|---|---|
| result | DateTime | The previous working day. |