From 8be7a436e749fd288c4e3220356b2f883262e9af Mon Sep 17 00:00:00 2001 From: Laura Moore Date: Tue, 4 Apr 2023 21:02:17 +0000 Subject: [PATCH] final date and room tweaks --- gwcc_export.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gwcc_export.html b/gwcc_export.html index ec206c28..ee975181 100644 --- a/gwcc_export.html +++ b/gwcc_export.html @@ -60,7 +60,7 @@ row.push('"' + s["title"] + '"') row.push('"' + formatDate(s["startsAt"]) + '"') row.push('"' + formatDate(s["endsAt"]) + '"') - row.push('"A' + room + '"') + row.push('"' + room + '"') //console.log([row, s]) csvData.push(row.join(",")) }) @@ -72,11 +72,15 @@ } } function formatDate(datestr) { - return new Date(datestr).toLocaleString();; + const date = new Date(datestr); + const datePart = date.toLocaleString("en-us", {month: "numeric",day: "numeric",year: "numeric"}); + const timePart = date.toLocaleString("en-us", {hour12: true, hour: "2-digit",minute: "2-digit"}); + return datePart+ " " +timePart } function formatRoom(roomStr) { + if(roomStr.includes('Sydney Marcus')) return 'Sydney Marcus'; const number = roomStr.match(/\d+/g); - if(number) return number[0]; + if(number) return "A" + number[0]; else return null; } function downloadObjectAsJson(exportObj, exportName) {