diff --git a/isso/js/app/isso.js b/isso/js/app/isso.js index 4312d45..168e3ea 100644 --- a/isso/js/app/isso.js +++ b/isso/js/app/isso.js @@ -101,7 +101,7 @@ define(["app/dom", "app/utils", "app/config", "app/api", "app/jade", "app/i18n", // update datetime every 60 seconds var refresh = function() { - $(".permalink > date", el).textContent = utils.ago( + $(".permalink > time", el).textContent = utils.ago( globals.offset.localTime(), new Date(parseInt(comment.created, 10) * 1000)); setTimeout(refresh, 60*1000); }; diff --git a/isso/js/app/jade.js b/isso/js/app/jade.js index 805338c..46d6269 100644 --- a/isso/js/app/jade.js +++ b/isso/js/app/jade.js @@ -21,6 +21,13 @@ define(["libjs-jade-runtime", "app/utils", "jade!app/text/postbox", "jade!app/te load("comment-loader", tt_comment_loader); set("bool", function(arg) { return arg ? true : false; }); + set("humanize", function(date) { + if (typeof date !== "object") { + date = new Date(parseInt(date, 10) * 1000); + } + + return date.toString(); + }); set("datetime", function(date) { if (typeof date !== "object") { date = new Date(parseInt(date, 10) * 1000); @@ -30,7 +37,11 @@ define(["libjs-jade-runtime", "app/utils", "jade!app/text/postbox", "jade!app/te date.getUTCFullYear(), utils.pad(date.getUTCMonth(), 2), utils.pad(date.getUTCDay(), 2) - ].join("-"); + ].join("-") + "T" + [ + utils.pad(date.getUTCHours(), 2), + utils.pad(date.getUTCMinutes(), 2), + utils.pad(date.getUTCSeconds(), 2) + ].join(":") + "Z"; }); return { diff --git a/isso/js/app/text/comment.jade b/isso/js/app/text/comment.jade index 1167d5b..cbbb245 100644 --- a/isso/js/app/text/comment.jade +++ b/isso/js/app/text/comment.jade @@ -12,7 +12,7 @@ div(class='isso-comment' id='isso-#{comment.id}') = bool(comment.author) ? comment.author : i18n('comment-anonymous') span(class="spacer") • a(class='permalink' href='#isso-#{comment.id}') - date(datetime='#{datetime(comment.created)}') + time(title='#{humanize(comment.created)}' datetime='#{datetime(comment.created)}') span(class='note') = comment.mode == 2 ? i18n('comment-queued') : comment.mode == 4 ? i18n('comment-deleted') : ''