1.0.7 • Published 5 years ago

split-interval v1.0.7

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

split-interval CircleCI

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 - A Date object representing the start of the interval to split
  • endDate - A Date object representing the end of the interval to split
  • startTime - A String in the format hh:mm:ss representing the start time of the interval segments
  • endTime - A String in the format hh:mm:ss representing 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:00PM
  • 2019-06-02 8:30AM - 2019-06-02 5:00PM
  • 2019-06-03 8:30AM - 2019-06-03 5:00PM
  • 2019-06-04 8:30AM - 2019-06-04 12:00PM
1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago