datetime-comparator

2.0.0 • Public • Published

datetime-comparator

A utility to compare two datetime range.

> const { compare } = require('datetime-comparator')
> compare('2 days', '[YYYY/MM/DD] 2017/01/01 - 2017/02/01')
-1
> ['2 months', '1 year', '[hh:mm] 10:00 - 12:00', '30 days'].sort(compare)
[ '[hh:mm] 10:00 - 12:00', '30 days', '2 months', '1 year' ]

Readme

Keywords

none

Package Sidebar

Install

npm i datetime-comparator

Weekly Downloads

49

Version

2.0.0

License

MIT

Last publish

Collaborators

  • poying