Calculating the event duration in hours and days

This documentation explains the logic of hours calculation used in the planning relying on several criteria such as the profile of the resource, the events in hours or days and so on.

Available time profiles: based on resources or company

Profile of the resource

"Resource" window, tab "Time frame" -> "Define work capacity relying on"

  • Time slots [RES-SLOT]: You can define morning and afternoon time slots for each working day of the week as well as non-working days.
  • Time slots

  • Number of hours [RES-HRS]: you can specify a number of hours worked for each working as well as non-working days of the week.
  • Number of hours for the profile

  • "Count all hours" option for the profile in number of hours [RES-HRS-COUNTALL]:
    If this option is checked, all the hours will be taken into account for an event in hours.
    If this option is not selected, the number of hours counted in a day is the number of hours defined in the profile for an event in hours.

    Number of hours Option count all hours

Company's overall profile

Menu Tools -> Options - > Timetables

Company's overall profile

  • Number of hours a day [COMP-HRS]: You can define a number of hours in a day for the company
  • Slots [COMP-SLOTS]: You can define morning and afternoon time-slots for the company
  • Night hours [COMP-NIGHT-SLOTS]: You can define the night slot.

Full-days event [EVT-ALLDAY]

For full-days events, the Full day box is checked. The event takes place over 1 or more full day(s) .
We distinguish 2 types of full-days events:

  • Full-days event with an end [EVT-ALLDAY-END] : The end of the event is specified
  • Event in days

  • Full-days event with a duration [EVT-ALLDAY-DURATION] : The duration of the event is specified in number of days. The end of the event is then calculated according to the time profile..
  • Event in hours

Events in hours [EVT-TIME]

Events in hours are defined with a start time and an end time. The "Whole day" box is unchecked.
We distinguish 2 types of events in hours:

  • Event in hours with an end [EVT-TIME-END] : The end of the event is specified
  • Event in hours with an end


  • Event in hours with a duration [EVT-TIME-DURATION] : The duration of the event is specified in hours and minutes. The end of the event is calculated according to the time profile.
  • Event in hours

Dividing events into periods

Event in hours

  • [PERIOD-ON]: Worked period defined in the resource profile
  • [PERIOD-OFF-MIDDLE]: Period not worked specified in the resource profile or public holidays in the middle of an event. This period is never taken into account when calculating hours.
  • [PERIOD-OFF-EXTREMITY]: Period not worked or public holidays at an extremity of an event

The various hour types in Excel reports

Here are the data you can analyse in your Excel reports:

The various hour types in Excel reports

  • Number of normal hours [Dat_Hours]: Number of working hours included in the resource profile [PERIOD-ON].
  • Number of extra hours [Dat_HoursExtra]: Number of working hours outside the resource time profile or on public holidays or on not-worked days AND at an extremity of an event [PERIOD-OFF-EXTREMITY].
  • Number of normal days [Dat_Days]: this value shows “in Days” the number of “Dat_Hour” for the event; number of worked hours (Dat_Hour) for the event, divided by the number of usual working hours of the profile (or default options).
  • Number of extra days [Dat_DaysExtra]: this value shows “in Days” the number of “Dat_HourExtra” for the event; number of extra hours (Dat_HoursExtra) for the event, divided by the number of usual working hours of the profile (or default options).
  • Number of night hours [Dat_NightHours]: number of worked hours included into the night slot [COMP-NIGHT-SLOTS]
  • Number of days hours [Dat_DayHours]: number of hours outside the night slot

Break

Break in an event is applicable on events in hours, and only on events lasting one day at most. Deduction is first calculated on extra hours [Dat_HoursExtra] and then on worked hours [Dat_Hours].

Public holidays

Subtract public holidays from calculated durations : From the menu Tools - Options - Event, you can choose to subtract public holidays from the calculated durations.

Some real life scenarios

Data

Company profile:

  • [COMP-SLOT] = 9 am to 12.30 am and 1.30 pm to 6 pm, i.e. 8 hours per day
  • [COMP-NIGHT-SLOTS] = 9 pm to 5 am
  • [COMP-HRS] = 8 hours per day

Full-day events with an end [EVT-ALLDAY-END]:

  • 1-day training on a worked day: Event over a full working day
  • 2-days training ending Saturday: Event over 2 days with the last day on a non-working day
  • 1-day training on Sunday: Event over a whole day not worked

Events in hours with an end [EVT-TIME-END]:

  • Training from 2 pm to 4 pm: Event in hours on a working period
  • Training from 4 pm to 10 pm: Event in hours with end time out of the time profile's working period
  • Training starting at 3 pm on Wednesday and ending at 12 am on Thursday: Event on several days in hours

Full-day events with duration [EVT-ALLDAY-DURATION]:

  • 1-day training on a working day: Event over a full working day
  • 2 days training starting Friday: The training then ends on Monday
  • 2-days training starting on a Sunday: 2-days event beginning Sunday -> The training ends on Monday

Event in time with a duration [EVT-TIME-DURATION]:

  • 2-hours training: Event beginning on a worked period
  • 15-hours training: Event beginning on a worked period
  • 2-hours training on a Sunday: Event starting on a period not worked
  • 10h training from 2 pm on a Sunday: Event starting on a period not worked

Scenario 1: [RES-SLOT] = 10 am to 12.30 am and 1.30 pm to 6 pm, i.e. 7 hours per day, everyday except Saturdays and Sundays

Outcome in the Excel report:

[RES-SLOT] = 10 am to 12.30 am and 1.30 pm to 6 pm, i.e. 7 hours per day, everyday except Saturdays and Sundays Dat_Hours Dat_HoursExtra Dat_NightHours
[EVT-ALLDAY-END] 1-day training on a worked day 7 0 0
[EVT-ALLDAY-END] 2-days training ending Saturday 7 8 0
[EVT-ALLDAY-END] 1-day training on Sunday 0 8 0
[EVT-TIME-END] Training 2 pm - 4 pm 2 0 0
[EVT-TIME-END] Training 4 pm - 10 pm 2 4 1
[EVT-TIME-END] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday 5 0 0
[EVT-ALLDAY-DURATION] 1-day training on a working day 7 0 0
[EVT-ALLDAY-DURATION] 2 days training starting Friday 14 0 0
[EVT-ALLDAY-DURATION] 2-days training starting on a Sunday 7 8 0
[EVT-TIME-DURATION] 2-hours training 2 0 0
[EVT-TIME-DURATION] 15-hours training 15 0 0
[EVT-TIME-DURATION] 2-hours training on a Sunday 0 2 0
[EVT-TIME-DURATION] 10h training from 2 pm on a Sunday 6 4 0

Details on the hours calculation:
[EVT-ALLDAY-END] 2-day training
[Dat_Hours] = 7 hours on Friday = [RES-SLOT]
[Dat_HoursExtra] = 8 hours on Saturday = [COMP-SLOT]

[EVT-TIME-END] Training from 4 pm to 10 pm
[Dat_Hours] = 2 hours from 4 pm to 6 pm
[Dat_HoursExtra] = 4 hours from 6 pm to 10 pm
[Dat_NightHours] = 1 hour from 9 pm to 10 pm

[EVT-TIME-END] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday
[Dat_Hours] = 5 hours including 3 hours on Wednesday from 3 pm to 6 pm and 2 hours on Thursday from 10 am to 12 am

Scenario 2: [RES-HRS] = 7 hours a day, everyday except Saturdays and Sundays

Outcome in the Excel report:

[RES-HRS] = 7 hours a day, everyday except Saturdays and Sundays Dat_Hours Dat_HoursExtra Dat_NightHours
[EVT-ALLDAY-END] 1-day training 7 0 0
[EVT-ALLDAY-END] 2-day training 7 8 0
[EVT-ALLDAY-END] 1-day training on Sunday 0 8 0
[EVT-TIME-END] Training 2 pm - 4 pm 2 0 0
[EVT-TIME-END] Training from 4 pm to 10 pm 6 0 1
[EVT-TIME-END] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday 14 0 1
[EVT-ALLDAY-DURATION] 1-day training on a working day 7 0 0
[EVT-ALLDAY-DURATION] 2 days training starting Friday 14 0 0
[EVT-ALLDAY-DURATION] 2-days training starting on a Sunday 7 8 0
[EVT-TIME-DURATION] 2-hours training 2 0 0
[EVT-TIME-DURATION] 15-hours training 15 0 0
[EVT-TIME-DURATION] 2-hours training on a Sunday 0 2 0
[EVT-TIME-DURATION] 10h training from 2 pm on a Sunday 0 10 0

Details on the hours calculation:

[EVT-ALLDAY-END] 2-day training
[Dat_Hours] = 7 hours on Friday = [RES-HRS]
[Dat_HoursExtra] = 8 hours on Saturday = [COMP-HRS]

[EVT-TIME-END] Training from 4 pm to 10 pm
[Dat_Hours] = 6 hours from 4 pm to 10 pm
[Dat_NightHours] = 1 hour from 9 pm to 10 pm

[EVT-TIME-END] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday
[Dat_Hours] = 14 hours including 7 hours on Wednesday from 5 pm to 10 pm and 7 hours on Thursday from 5 am to 10 pm because maximum hours counted on a day is 7 hours for profile [RES-HRS]
[Dat_NightHours] = 1 hour from 9 pm to 10 pm on Wednesday

Scenario 3: [RES-HRS-COUNTALL] = 7 hours a day with the option "Count all hours", everyday except Saturdays and Sundays

Outcome in the Excel report:

[RES-HRS-COUNTALL] = 7 hours a day with the option "Count all hours", everyday except Saturdays and Sundays Dat_Hours Dat_HoursExtra Dat_NightHours
[EVT-ALLDAY-END] 1-day training 7 0 0
[EVT-ALLDAY-END] 2-day training 7 8 0
[EVT-ALLDAY] 1-day training on Sunday 0 8 0
[EVT-TIME-END] Training 2 pm - 4 pm 2 0 0
[EVT-TIME-END] Training from 4 pm to 10 pm 6 0 1
[EVT-TIME-END] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday 21 0 8
[EVT-ALLDAY-DURATION] 1-day training on a working day 7 0 0
[EVT-ALLDAY-DURATION] 2 days training starting Friday 14 0 0
[EVT-ALLDAY-DURATION] 2-days training starting on a Sunday 7 8 0
[EVT-TIME-DURATION] 2-hours training 2 0 0
[EVT-TIME-DURATION] 15-hours training 15 0 0
[EVT-TIME-DURATION] 2-hours training on a Sunday 0 2 0
[EVT-TIME-DURATION] 10h training from 2 pm on a Sunday 2 8 0

Details on the hours calculation:

[EVT-ALLDAY-END] 2-day training
[Dat_Hours] = 7 hours on Friday = [RES-HRS]
[Dat_HoursExtra] = 8 hours on Saturday = [COMP-HRS]

[EVT-TIME-END] Training from 4 pm to 10 pm
[Dat_Hours] = 6 hours from 4 pm to 10 pm
[Dat_NightHours] = 1 hour from 9 pm to 10 pm

[EVT-TIME-END] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday
[Dat_Hours] = 21 hours including 9 hours on Wednesday from 3 pm to midnight and 12 hours on Thursday from midnight to 12 am.
[Dat_NightHours] = 8 hours including 3 hours from 9 pm to midnight and 5 hours from midnight to 5 am.

Events expressed in duration

Calculation of the end according to the profile
For events with a specified duration, the end is calculated based on the resource's time profile.

Some use cases:
[EVT-ALLDAY-DURATION] 2 days training starting Friday
This event ends the following Monday because weekends are not counted.

[EVT-TIME-DURATION] Training lasts 15 hours starting from 9 am on Wednesday
[RES-HRS] : 7 hours are counted on the first day then 7 hours on the second day then 1 hour on the third day. The event will therefore be spread over 3 days.
[RES-HRS-COUNTALL] : 15 consecutive hours are counted. The event ends at 6 am Thursday morning.

Reports creation

You will then be able to generate dashboards on the number of worked hours, overtime hours, night hours either through Excel reports or through an integration with our API.