Name: moment-relative
Owner: BBC
Description: Support for Graphite-style relative time strings in Moment.js
Created: 2015-05-06 15:02:20.0
Updated: 2015-12-22 10:14:04.0
Pushed: 2016-01-04 09:36:10.0
Homepage: null
Size: 4
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Support for Graphite-style relative time strings in Moment.js
install moment-relative
moment = require('moment-relative');
now = moment();
someTimeAgo = now.relative('-5d3h5m');
quivalent of now.subtract(5, 'days').subtract(3, 'hours').subtract(5, 'minutes');
|Unit|Description| |—-|———–| |d|Days| |h|Hours| |m|Minutes| |s|Seconds|