cal icon indicating copy to clipboard operation
cal copied to clipboard

Possibility to add interval time to a workday

Open EsterfanoLopes opened this issue 3 years ago • 1 comments

I was reading the docs and searching in the code if is possible to add an interval time in a Workday.

Like:

c := cal.NewBusinessCalendar()
c.SetWorkHours(time.Hour*9, time.Hour*18)

But from 12 am to 1pm there's an interval where shouldn't be considered as work hours.

How I can do that? If it's not possible, I'll leave as a idea for the future.

EsterfanoLopes avatar Sep 01 '21 21:09 EsterfanoLopes

There's nothing to support that right now and I think that would require a lot of refactoring to handle. In the meantime, the best alternative I can think of is creating two separate calendars for "morning" (9-12) and "afternoon" (13-18) with the same holidays and adding the results of both together.

rickar avatar Sep 04 '21 15:09 rickar