From 6d52827576de5e13b98b8c9a36f97e686177e32c Mon Sep 17 00:00:00 2001
From: Sven Fuchs <me@svenfuchs.com>
Date: Tue, 5 Nov 2013 15:48:30 +0100
Subject: [PATCH] timeago: assume "now" when date is in the future

---
 assets/scripts/vendor/jquery.timeago.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/assets/scripts/vendor/jquery.timeago.js b/assets/scripts/vendor/jquery.timeago.js
index 87076349..a18818b7 100644
--- a/assets/scripts/vendor/jquery.timeago.js
+++ b/assets/scripts/vendor/jquery.timeago.js
@@ -24,7 +24,7 @@
   $.extend($.timeago, {
     settings: {
       refreshMillis: 3000,
-      allowFuture: true,
+      allowFuture: false,
       strings: {
         prefixAgo: null,
         prefixFromNow: null,
@@ -64,6 +64,10 @@
           suffix = $l.suffixFromNow;
         }
         distanceMillis = Math.abs(distanceMillis);
+      } else {
+        if (distanceMillis < 0) {
+          distanceMillis = 0;
+        }
       }
 
       var seconds = distanceMillis / 1000;
@@ -78,9 +82,9 @@
         return string.replace(/%d/i, value);
       }
 
-      var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
+      var words = seconds < 55 && substitute($l.seconds, Math.round(seconds)) ||
         seconds < 90 && substitute($l.minute, 1) ||
-        minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
+        minutes < 55 && substitute($l.minutes, Math.round(minutes)) ||
         minutes < 90 && substitute($l.hour, 1) ||
         hours < 24 && substitute($l.hours, Math.round(hours)) ||
         hours < 48 && substitute($l.day, 1) ||