From 2e8b36957edad562e8ffe0802e7c7464abecd2c0 Mon Sep 17 00:00:00 2001 From: MMP0 Date: Thu, 18 May 2017 09:43:17 +0900 Subject: [PATCH] Small changes --- public/js/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index baaa62a9..44e885d4 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -18,7 +18,8 @@ function toggleLayer(elem) { // Date formatting var lang = $("html").attr("lang"); -var shortOpt = { year: "numeric", month: "short", day: "numeric" }; +var ymdOpt = { year: "numeric", month: "short", day: "numeric" }; +var hmOpt = { hour: "numeric", minute: "numeric" }; var list = document.getElementsByClassName("date-short"); for(var i in list) { @@ -38,12 +39,12 @@ var list = document.getElementsByClassName("date-comments"); for(var i in list) { var e = list[i]; e.title = e.innerText; - e.innerText = new Date(e.title).toLocaleDateString(lang, { year: "numeric", month: "short", day: "numeric"}) + " "; - $(e).append($('').text(new Date(e.title).toLocaleTimeString(lang, { hour:"numeric", minute:"numeric" }))) + e.innerText = new Date(e.title).toLocaleDateString(lang, ymdOpt) + " "; + $(e).append($('').text(new Date(e.title).toLocaleTimeString(lang, hmOpt))) } /*Fixed-Navbar offset fix*/ window.onload = function() { var shiftWindow = function() { scrollBy(0, -70) }; if (location.hash) shiftWindow(); window.addEventListener("hashchange", shiftWindow); -}; \ No newline at end of file +};