1.0.1 • Published 2 years ago
datetime-period v1.0.1
UNDER DEVELOPMENT :construction_worker:
The library Time Period for handling periods of time. This library is inspired from Time Period Library for .NET
Install
npm i datetime-period
Example
const { TimeRange, TimeRelation } = require('datetime-period');
var timeRangeA = new TimeRange('2020-12-12 14:00:00', '2020-12-12 16:00:00');
var timeRangeB = new TimeRange('2020-12-12 09:00:00', '2020-12-12 11:00:00');
var timeRelation = new TimeRelation(timeRangeA, timeRangeB);
console.log('Relation :', timeRelation.getRelation(), ', Is Overlapped : ', timeRelation.isOverlapped());
/// Output:
/// Relation : After , Is Overlapped : false
Demo
node tests/index.js
image from Jani Giannoudis