@jgoizueta/timerange

1.7.1 • Public • Published

TimeRange

A class to represent time ranges (interval of time between to instants).

const { TimeRange } = require('@jgoizueta/timerange');

const t = TimeRange.fromText('2018-03');
console.log(t.next().text);
console.log(t.startValue, t.endValue);

Output:

2018-04
1519862400000 1522540800000
for (let t = TimeRange.fromText('2018-Q2'); t.precedes(TimeRange.fromText('2019-Q2')); t = t.next()) {
    console.log(t.text);
}

Output:

2018-Q2
2018-Q3
2018-Q4
2019-Q1

Readme

Keywords

none

Package Sidebar

Install

npm i @jgoizueta/timerange

Weekly Downloads

10

Version

1.7.1

License

BSD-3-Clause

Unpacked Size

122 kB

Total Files

14

Last publish

Collaborators

  • jgoizueta