Creates a new OnCallPeriod and automatically calculates OOH days.
The constructor immediately analyzes the period to determine which days qualify as out-of-hours work, categorizing them into weekdays and weekends.
Start date/time of the on-call period
End date/time of the on-call period
IANA timezone identifier (defaults to 'UTC')
ReadonlysinceStart date/time of the on-call period
ReadonlytimeIANA timezone identifier (e.g., 'Europe/London', 'America/New_York')
ReadonlyuntilEnd date/time of the on-call period
Gets the number of OOH weekdays (Monday-Thursday) in this period.
Count of OOH weekdays
Gets the number of OOH weekend days (Friday-Sunday) in this period.
Count of OOH weekend days
Represents a continuous on-call period with automatic OOH (Out of Hours) calculation.
This class encapsulates the business logic for determining whether on-call shifts qualify as "out of hours" work and categorizing them into weekdays vs. weekends. It uses timezone-aware date handling to ensure accurate calculations across different geographical locations.
Remarks
OOH Qualification Criteria
A shift qualifies as OOH (Out of Hours) if it meets ALL of the following:
Day Classification
Note: Friday is considered a weekend day for compensation purposes.
Timezone Handling
All date calculations respect the provided timezone to ensure accurate determination of "end of work day" and day boundaries. This is critical for distributed teams across multiple timezones.
Example