From fae66fd282fb042620d89d2b3f9a135bb7f86b2f Mon Sep 17 00:00:00 2001 From: foxster-mp4 Date: Mon, 22 May 2023 10:14:11 -0700 Subject: [PATCH] Update app.css & app.js --- css/app.css | 4 ++++ js/app.js | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/css/app.css b/css/app.css index 72785c2..5fc1670 100644 --- a/css/app.css +++ b/css/app.css @@ -115,6 +115,10 @@ a { opacity: 0.35; } +#whats-new #version-date { + text-align: right; +} + #whats-new #version-description { -webkit-line-clamp: 3; line-clamp: 3; diff --git a/js/app.js b/js/app.js index 98ae6ac..6b3b1e7 100644 --- a/js/app.js +++ b/js/app.js @@ -105,7 +105,6 @@ function main(json) { const versionNumberElement = document.getElementById("version"); const versionSizeElement = document.getElementById("version-size"); const versionDescriptionElement = document.getElementById("version-description"); - const versionDate = new Date(app.versionDate), month = versionDate.toUTCString().split(" ")[2], date = versionDate.getDate(); @@ -114,8 +113,8 @@ function main(json) { const msDifference = today.valueOf() - versionDate.valueOf(); // Version date - versionDateElement.textContent = `${month} ${date}, ${versionDate.getFullYear()}`; - if (msDifference <= msPerDay) + versionDateElement.textContent = versionDate.valueOf() ? `${month} ${date}, ${versionDate.getFullYear()}` : app.versionDate.split("T")[0]; + if (msDifference <= msPerDay && today.getDate() == versionDate.getDate()) versionDateElement.textContent = "Today"; else if (msDifference <= msPerDay * 2) versionDateElement.textContent = "Yesterday";