Define your organization’s weekend boundaries for rules that reference idle weekends, such as WEEKENDS_IDLE counters.
Why Define Weekends?
Different industries and regions have varying definitions of “weekend”:
- Standard: Friday evening to Sunday night
- Retail/Hospitality: Saturday morning to Monday morning
- Healthcare: 36-hour blocks with specific start times
Basic Weekend Definition
Set the weekend boundaries in the options.idleWeekend object:
{
"options": {
"idleWeekend": {
"fromDayOfWeek": "FRIDAY",
"fromTime": "19:00:00",
"toDayOfWeek": "SUNDAY",
"toTime": "23:00:00"
}
}
}
A weekend is considered “idle” if the employee has no shifts during the entire defined window.
Weekend Properties
Day when the weekend starts: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
Time when the weekend starts (HH:mm:ss format)
Day when the weekend ends
Time when the weekend ends (HH:mm:ss format)
restTime
string (ISO 8601 duration)
Minimum consecutive idle time within the window to count as a free weekend
Common Weekend Configurations
Standard
Retail
Healthcare
Friday 7 PM to Sunday 11 PM:{
"options": {
"idleWeekend": {
"fromDayOfWeek": "FRIDAY",
"fromTime": "19:00:00",
"toDayOfWeek": "SUNDAY",
"toTime": "23:00:00"
}
}
}
Saturday 8 AM to Monday 8 AM:{
"options": {
"idleWeekend": {
"fromDayOfWeek": "SATURDAY",
"fromTime": "08:00:00",
"toDayOfWeek": "MONDAY",
"toTime": "08:00:00"
}
}
}
Saturday midnight to Monday 6 AM:{
"options": {
"idleWeekend": {
"fromDayOfWeek": "SATURDAY",
"fromTime": "00:00:00",
"toDayOfWeek": "MONDAY",
"toTime": "06:00:00"
}
}
}
Using Weekend Rules
Once defined, use weekend constraints in rules:
{
"rules": [
{
"constraint": "COUNTER",
"type": "WEEKENDS_IDLE",
"min": 2,
"period": {
"from": "2024-01-01",
"to": "2024-01-31"
}
}
],
"options": {
"idleWeekend": {
"fromDayOfWeek": "FRIDAY",
"fromTime": "19:00:00",
"toDayOfWeek": "SUNDAY",
"toTime": "23:00:00"
}
}
}
Each employee gets at least 2 completely free weekends in January.
Rest Time Requirement
Use restTime to require a minimum consecutive rest period within the weekend window:
{
"options": {
"idleWeekend": {
"fromDayOfWeek": "FRIDAY",
"fromTime": "19:00:00",
"toDayOfWeek": "SUNDAY",
"toTime": "23:00:00",
"restTime": "PT36H"
}
}
}
With restTime, an employee can work part of the weekend and still have it count as “idle” if they get 36 consecutive hours off within the window.