1.0.7 • Published 6 years ago
split-interval v1.0.7
split-interval 
Splits the given interval across multiple days with start and end times.
Usage
const splitInterval = require('split-interval');
splitInterval(startDate, endDate, startTime, endTime);Arguments
startDate- ADateobject representing the start of the interval to splitendDate- ADateobject representing the end of the interval to splitstartTime- AStringin the formathh:mm:ssrepresenting the start time of the interval segmentsendTime- AStringin the formathh:mm:ssrepresenting the end of the interval segments
Example
Given the following interval 2019-06-01 12:00 PM to 2019-06-04 12:00 PM, with segments 8:30 AM to 5:00 PM, we will get the following segments as the result:
2019-06-01 12:00PM-2019-06-01 5:00PM2019-06-02 8:30AM-2019-06-02 5:00PM2019-06-03 8:30AM-2019-06-03 5:00PM2019-06-04 8:30AM-2019-06-04 12:00PM