Manipulations with Postgres interval columns
Install this package in your project:
$ npm install --save postgres-interval-class
Call require to get the instance:
const { PostgresColumnInterval } = require('postgres-interval-class');
Or in ES6 and TS:
import PostgresColumnInterval from 'postgres-interval-class';
const pi = new PostgresColumnInterval('00:15:00');
pi.add(new PostgresColumnInterval('00:05:00'));
pi.add(new Date('2014-03-09T01:59:00'));
pi.sub(new PostgresColumnInterval('00:05:00'));
pi.sub(new Date('2014-03-09T01:59:00'));
pi.toString();
pi.toJSON();