From 3755276f22c68a42f5f5fe8a3b59786a1d9bab07 Mon Sep 17 00:00:00 2001 From: Mark Eaton Date: Mon, 29 Mar 2021 10:20:38 -0400 Subject: [PATCH] abbreviate Wednesday; more titlecase --- groups/new-homepage-3/homepage3-js-css.html | 10 ++++++++-- groups/new-homepage-3/homepage3-template.html | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/groups/new-homepage-3/homepage3-js-css.html b/groups/new-homepage-3/homepage3-js-css.html index cf776a9..75a1197 100644 --- a/groups/new-homepage-3/homepage3-js-css.html +++ b/groups/new-homepage-3/homepage3-js-css.html @@ -367,6 +367,12 @@ window.onload = function () { for (var i = 0; i < h.length; i++) { let targetDate = new Date(h[i].Date + "T00:00:00.000-05:00"); let today = new Date(); + if (targetDate.toLocaleDateString("en-US", options_weekday) === "Wednesday") { + weekday = "Wed" + } else { + weekday = targetDate.toLocaleDateString("en-US", options_weekday) + } + console.log(weekday); if (targetDate.getFullYear() === today.getFullYear() && targetDate.getMonth() === today.getMonth() && targetDate.getDate() === today.getDate()) { @@ -374,10 +380,10 @@ window.onload = function () { var start = true; var count = 1; } else if (start === true && count < 3 && h[i].Hours === "Closed" ) { - document.getElementById('hours' + count).innerHTML = "

" + targetDate.toLocaleDateString("en-US", options_weekday) + "
" + targetDate.toLocaleDateString("en-US", options_date) + "
" + h[i].Hours + "

"; + document.getElementById('hours' + count).innerHTML = "

" + weekday + "
" + targetDate.toLocaleDateString("en-US", options_date) + "
" + h[i].Hours + "

"; count++; } else if (start === true && count < 3 && h[i].Hours != "Closed") { - document.getElementById('hours' + count).innerHTML = "

" + targetDate.toLocaleDateString("en-US", options_weekday) + "
" + targetDate.toLocaleDateString("en-US", options_date) + "
" + h[i].Hours + "

"; + document.getElementById('hours' + count).innerHTML = "

" + weekday + "
" + targetDate.toLocaleDateString("en-US", options_date) + "
" + h[i].Hours + "

"; count++; } } diff --git a/groups/new-homepage-3/homepage3-template.html b/groups/new-homepage-3/homepage3-template.html index d988ef1..484ac18 100644 --- a/groups/new-homepage-3/homepage3-template.html +++ b/groups/new-homepage-3/homepage3-template.html @@ -5,7 +5,7 @@