Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Business calendar : Calculating the duration : Working hours for special business hours
 

Working hours for special business hours

For special business hours, the working hours are calculated considering the regular Mid-day break Start and End time for that particular calendar.
Typically, it is calculated as:
[Special End Time - Special Start Time]
minus
[earlier of (Regular Mid-day Break End Time) or (Special End Time)] minus [later of (Regular Mid-day Break Start Time) or (Special Start Time)]
Consider a calendar with:
*Regular Start Time: 09:00
*Regular End TIme: 18:00
*Mid-day Break Start Time: 13:00
*Mid-day Break End Time: 14:00
The Table 2 illustrates the use of Mid-day Break hours.
Table 2. Special business hours examples
Special business hours
Duration
Comment
Start Time
End Time
07:00
13:30
(13:30 - 07:00) - (13:30 - 13:00) 6 Hours
Special End Time occurs earlier than Mid-day Break End Time.
Part of Mid-day Break considered.
07:00
13:00
(13:00 - 07:00) 6 Hours
Special Hours end when Mid-day Break begins.
07:00
12:00
(12:00 - 07:00)5 Hours
Special Hours end before Mid-day Break begins.
13:30
22:00
(22:00 - 13:30) - (14:00 - 13:30)8 Hours
Special Start Time occurs later than Mid-day Break Start Time.
Part of Mid-day Break considered.
14:00
22:00
(22:00 - 14:00)8 Hours
Special Hours begin when Mid-day Break ends.
15:00
22:00
(22:00 - 15:00)7 Hours
Special Hours begin after Mid-day Break ends.
07:00
22:00
(22:00 - 07:00) - (14:00 - 13:00) 14 Hours
Special Hours begin before Mid-day Break begins, and Special Hours end after Mid-day Break ends.
Entire Mid-day Break considered.
Note that the Mid-day Break hours are considered only when they fully or partly fall within the special business hours.