From d2b2a8bc9e88e7601d48c03a52eaf045f43ed622 Mon Sep 17 00:00:00 2001 From: Ryan McGeary Date: Wed, 14 Dec 2011 09:20:18 -0500 Subject: [PATCH] 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. --- jquery.timeago.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jquery.timeago.js b/jquery.timeago.js index a999059..e8daf76 100644 --- a/jquery.timeago.js +++ b/jquery.timeago.js @@ -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;