From 82c87ce07219e4e31e9a5ff9710f65fbaa4770d9 Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Fri, 31 Dec 2021 15:30:00 +0100 Subject: [PATCH] Update listener.js --- ND_ATMs/source/ui/js/listener.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ND_ATMs/source/ui/js/listener.js b/ND_ATMs/source/ui/js/listener.js index f957807..887178c 100644 --- a/ND_ATMs/source/ui/js/listener.js +++ b/ND_ATMs/source/ui/js/listener.js @@ -55,8 +55,8 @@ $(function() { confirmationScreen(false) successScreen(false) - const months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; - const d = new Date(); + const options = {year: 'numeric', month: 'long', day: 'numeric'}; + const today = new Date(); window.addEventListener("message", function(event) { const item = event.data; @@ -64,7 +64,7 @@ $(function() { display(true) $("#playername").text(item.playerName) $("#balance").text(item.balance) - $("#date").text(item.date + ", " + months[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear()) + $("#date").text(`${item.date}, ${today.toLocaleDateString("en-US", options)}`) $("#time").text(item.time) } else { display(false)