Update listener.js

This commit is contained in:
Andyyy7666
2021-12-31 15:30:00 +01:00
committed by GitHub
parent 3d3d56183a
commit 82c87ce072

View File

@@ -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)