union for when you have multiple shifts within the same time period (e.g. different people on a team) and want to find the effective shift when somebody is working.
intersect for a similar scenario, but you want to find when somebody is not working.
It's possible that this might be problematic to implement in a general sense because it could be nondeterministic with shifts that go into the next day. I'm going to be writing this anyway as we have the requirement to do this within a day, but would be happy to have a go at writing a more general approach if you're interested in having it in the library?
Use cases:
union
for when you have multiple shifts within the same time period (e.g. different people on a team) and want to find the effective shift when somebody is working.intersect
for a similar scenario, but you want to find when somebody is not working.It's possible that this might be problematic to implement in a general sense because it could be nondeterministic with shifts that go into the next day. I'm going to be writing this anyway as we have the requirement to do this within a day, but would be happy to have a go at writing a more general approach if you're interested in having it in the library?