ages
Your terrible time estimator.
Example
ages.until(weekFromNow);
ages.until(now);
ages.until(inAThousandYears);
ages.ago(tuesday, thursday);
ages.ago(nextWeek, today);
ages.ago(theNineties);
ages.ago(a, b, {
minute: 'years',
hour: 'minutes',
day: 'week',
week: 'years',
month: '?',
year: 'month',
fallback: 'seconds'
});
API
ages.ago(target[, fromDate[, formats]]) -> String
Returns an estimate of how long ago a given date was.
Takes the following arguments:
target
Date|String|Number - the target datefromDate
Date|String|Number - the start date (defaults to now)formats
Object - customize formatting of different units
ages.until(target[, fromDate[, formats]]) -> String
Returns an estimate of how long until given a date is.
Takes the following arguments:
target
Date|String|Number - the target datefromDate
Date|String|Number - the start date (defaults to now)formats
Object - customize formatting of different units
ages.msToString(ms[, formats]) -> String
Returns a rough estimation of the milliseconds given.
Takes the following arguments:
ms
Number - positive time in millisecondsformats
Object - customize formatting of different units