Get a string representation of a time difference
To Install
$ npm install --save epoch-to-timeago
Usage
var timeAgo = timeAgo var originalTime = var oneSecond = originalTime + 1000var twoMinutes = originalTime + 2000 * 60 // 1 second ago // 2 minutes ago
Cutoffs
Don't like the default cutoffs? Replace them with your own!
var convert = convertcutoffseconds = 63 // 61 seconds ago // 1 minute ago
Suffixes
Don't like the default suffixes? Replace them with your own!
var convert = convertsuffixDictionary = var timeAgo = converttimeAgo // 1 zweite vor // 2 vor sekundan
Time Calculations
Don't like the default time calculations? Replace them with your own!
var convert = converttimeCalcs { // 30 day month instead of 31 return currentEpoch - pastEpoch / 1000 / 60 / 60 / 24 / 30}var timeAgo = converttimeAgo
License
MIT