moment-relative
Support for Graphite-style relative time strings in Moment.js
Installation
npm install moment-relative
Usage
var moment = ; var now = ;var someTimeAgo = now;// equivalent of now.subtract(5, 'days').subtract(3, 'hours').subtract(5, 'minutes');
Supported units
Unit | Description |
---|---|
d | Days |
h | Hours |
m | Minutes |
s | Seconds |