Skip to content

Commit

Permalink
internal relativeTime now accepts only duration object
Browse files Browse the repository at this point in the history
  • Loading branch information
ichernev committed Jun 19, 2014
1 parent af40f1d commit fea95b1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions moment.js
Original file line number Diff line number Diff line change
Expand Up @@ -1598,10 +1598,8 @@
return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
}

function relativeTime(msOrDuration, withoutSuffix, lang) {
var duration = (typeof msOrDuration === "number" ?
moment.duration(Math.abs(msOrDuration)) :
moment.duration(msOrDuration).abs()),
function relativeTime(posNegDuration, withoutSuffix, lang) {
var duration = moment.duration(posNegDuration).abs(),
seconds = round(duration.as('s')),
minutes = round(duration.as('m')),
hours = round(duration.as('h')),
Expand Down

0 comments on commit fea95b1

Please sign in to comment.