From 62e67c75b7b710aaedf842eda16c4a4b86041969 Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 16 Nov 2014 00:11:47 +0100 Subject: [PATCH] smaller ago.js --- app/assets/javascripts/ago.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/ago.js b/app/assets/javascripts/ago.js index 3eea9b8..ea46d8c 100644 --- a/app/assets/javascripts/ago.js +++ b/app/assets/javascripts/ago.js @@ -23,14 +23,8 @@ function Ago(nodes, options) { return new Date(node.getAttribute("datetime")); }, format: function(time, unit) { - if (!unit) { - return "just now"; - } - if (time < 0) { - var tail = " ahead"; - } else { - var tail = " ago"; - } + if (!unit) return "just now"; + var tail = time < 0 ? " ahead" : " ago"; return Math.abs(time) + " " + unit + tail; }, plural: {