1.0.1 • Published 2 years ago

datetime-period v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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 version

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

Time Period from Jani Giannoudis image from Jani Giannoudis