bbc/moment-relative

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

moment-relative

Build Status Code Climate

Support for Graphite-style relative time strings in Moment.js

Installation
install moment-relative
Usage
moment = require('moment-relative');

now = moment();
someTimeAgo = now.relative('-5d3h5m');
quivalent of now.subtract(5, 'days').subtract(3, 'hours').subtract(5, 'minutes');
Supported units

|Unit|Description| |—-|———–| |d|Days| |h|Hours| |m|Minutes| |s|Seconds|


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.