From 413fb0c9a6a32a86bde9234762d3209ad4d834f6 Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Mon, 9 Sep 2013 13:24:03 +0200 Subject: [PATCH] automatically update time(ago) every minute --- isso/client/app/isso.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/isso/client/app/isso.js b/isso/client/app/isso.js index ddd24e4..f47f70f 100644 --- a/isso/client/app/isso.js +++ b/isso/client/app/isso.js @@ -50,7 +50,10 @@ define(["lib/q", "lib/HTML", "helper/utils", "./api", "./forms", "./logging"], f var permalink = node.header.add("a.permalink"); permalink.href = '#isso-' + comment.id; permalink.add("date[datetime=" + date.getUTCFullYear() + "-" + date.getUTCMonth() + "-" + date.getUTCDay() + "]") - .textContent = utils.ago(date); + var refresh = function() { + permalink.date.textContent = utils.ago(date); + setTimeout(refresh, 60*1000) + }; refresh(); node.query("span.avatar").add("img[width=48 height=48]");