-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Observed Behaviour
Using two datespans:
span1: date1, 11:00 - 12:00 (duration: 60 Minutes) and
span1: date1, 12:00 - 13:00
the union of such ranges is always null.
span3 = span1.union(span2); // null
Expected Behaviour
The union of such ranges "in many usecases" - e.g. merging the freebusytimes of an exchange server -
should be
r3: date 1, 11:00 - 13:00
It might be helpful to have a flag "mergeAdjacent" which can be set to true/false.
when set to true r3 shall be created if set to false r3 shall be null.
see .e.g. moment-range - npm - https://www.npmjs.com/package/moment-range#add
Steps to Reproduce
var currentStartDate = new Date(2021, 02, 20, 11, 0, 0, 0);
let intervalMinutes = 60
let span1 = myDateSpanCTor(currentStartDate, null, intervalMinutes, 0, 0)
currentStartDate = new Date(currentStartDate.getTime() + intervalMinutes * 60000)
let span2 = myDateSpanCTor(currentStartDate, null, intervalMinutes, 0, 0)
span3 = span1.union(span2); // null instead of
System Configuration
caltime version: 1.4.5
Node.js version: 15.8.0
NPM version: 7.5.4
lodash version: ./.
moment-timezone version: ./.