1.1.7 • Published 1 year ago

time-gaps v1.1.7

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
1 year ago

time-gaps

A simple module for working with time intervals

Installation

$ npm install time-gaps

Usage

const timeGaps = require('time-gaps');

Example

const timeGaps = require('time-gaps');

// previously available intervals
const oldIntervals = [{
  from: '2015-08-03T13:00:00.000Z',
  to: '2015-08-03T13:30:00.000Z',
}, {
  from: '2015-08-03T14:00:00.000Z',
  to: '2015-08-03T14:30:00.000Z',
}];

const newIntervals = [{
  from: '2015-08-03T12:45:00.000Z',
  to: '2015-08-03T13:15:00.000Z',
}];

const mergedIntervals = timeGaps.megre(newIntervals, oldIntervals);
/*
[
  {
    from: '2015-08-03T12:45:00.000Z',
    to: '2015-08-03T13:00:00.000Z',
  },
  {
    from: '2015-08-03T13:00:00.000Z',
    to: '2015-08-03T13:30:00.000Z',
  },
  {
    from: '2015-08-03T14:00:00.000Z',
    to: '2015-08-03T14:30:00.000Z',
  },
] */
1.1.7

1 year ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago