From 6822da82d9f42ea5a775763eff3e71ddd7f2c117 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 1 May 2014 12:42:08 +0200 Subject: [PATCH] Fixed bug with cutoff and allowFuture To reproduce the bug use these settings: ```js $.timeago.settings.cutoff = 7 * 86400000;// one week in milliseconds $.timeago.settings.allowFuture = true ``` You will se that the cutoff have no effect on a future date. --- jquery.timeago.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.timeago.js b/jquery.timeago.js index 44539a4..87deaa6 100644 --- a/jquery.timeago.js +++ b/jquery.timeago.js @@ -179,7 +179,7 @@ var $s = $t.settings; if (!isNaN(data.datetime)) { - if ( $s.cutoff == 0 || distance(data.datetime) < $s.cutoff) { + if ( $s.cutoff == 0 || Math.abs(distance(data.datetime)) < $s.cutoff) { $(this).text(inWords(data.datetime)); } }