smaller ago.js

This commit is contained in:
jomo
2014-11-16 00:11:47 +01:00
parent 4ee1f7320b
commit 62e67c75b7

View File

@@ -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: {