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.

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.

Available time slots: per resources or company schedules

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 of 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.

All-day events or events in hours

"Task" or "Unavailability" events are represented by a colored rectangle on the planning board.

  • All-day events: The "All day" box is checked.
  • Event in days

  • Event in hours [EVT-HRS]: start and end time are specified
  • 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 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].

    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

    Events on a full day [EVT-FULLDAY]:

    • 1-day training: event on a full working day
    • 2-day training: event on 2 full days with last day on a non-working day
    • 1-day training on Sunday: event on a full day on a non-working period

    Event in hours [EVT-HRS]:

    • 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 profile's working period
    • Training starting at 3 pm on Wednesday and ending at 12 am on Thursday: Event on several days in hours

    Events types

    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-FULLDAY] 1-day training 7 0 0
    [EVT-FULLDAY] 2-day training 7 8 0
    [EVT-FULLDAY] 1-day training on Sunday 0 8 0
    [EVT-HRS] Training 2 pm - 4 pm 2 0 0
    [EVT-HRS] Training 4 pm - 10 pm 2 4 1
    [EVT-HRS] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday 5 0 0

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

    [EVT-HRS] 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-HRS] 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-FULLDAY] 1-day training 7 0 0
    [EVT-FULLDAY] 2-day training 7 8 0
    [EVT-FULLDAY] 1-day training on Sunday 0 8 0
    [EVT-HRS] Training 2 pm - 4 pm 2 0 0
    [EVT-HRS] Training from 4 pm to 10 pm 6 0 1
    [EVT-HRS] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday 14 0 1

    Details on the hours calculation:

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

    [EVT-HRS] 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-HRS] 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 slot [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-FULLDAY] 1-day training 7 0 0
    [EVT-FULLDAY] 2-day training 7 8 0
    [EVT-FULLDAY] 1-day training on Sunday 0 8 0
    [EVT-HRS] Training 2 pm - 4 pm 2 0 0
    [EVT-HRS] Training from 4 pm to 10 pm 6 0 1
    [EVT-HRS] Training starting at 3 pm on Wednesday and ending at 12 am on Thursday 21 0 8

    Details on the hours calculation:

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

    [EVT-HRS] 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-HRS] 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.