Changed the value passed to the substitution functions from abs to signed

Instead of passing only possitive millisecond values to string substitution
functions, now a signed millisecond value is passed.  Negative impies a future
timestamp. Postive implies a past timestamp. This might seem a little backward,
but the plugin is called "timeago" afterall.
This commit is contained in:
Ryan McGeary 2011-12-14 09:20:18 -05:00
parent bda21164a7
commit d2b2a8bc9e

View file

@ -57,10 +57,9 @@
prefix = $l.prefixFromNow;
suffix = $l.suffixFromNow;
}
distanceMillis = Math.abs(distanceMillis);
}
var seconds = distanceMillis / 1000;
var seconds = Math.abs(distanceMillis) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;