From c777339de5470c4c71a060f1e8ce621701e0c4a1 Mon Sep 17 00:00:00 2001 From: Michael Dickson Date: Tue, 20 Aug 2024 10:49:38 -0400 Subject: [PATCH] use current year in initial block, update msg - main js for details block now programmatically retrieves current year - updated missing data msg for calendar view --- blocks/gmo-program-details/gmo-program-details.js | 4 +++- scripts/program-calendar.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/blocks/gmo-program-details/gmo-program-details.js b/blocks/gmo-program-details/gmo-program-details.js index 263d34d..06e1d3b 100644 --- a/blocks/gmo-program-details/gmo-program-details.js +++ b/blocks/gmo-program-details/gmo-program-details.js @@ -89,6 +89,8 @@ export default async function decorate(block) { const audiences = buildAudienceList(program).outerHTML; const artifactLinks = buildArtifactLinks(program).outerHTML; + const currentYear = new Date().getFullYear(); + // Inject the additional HTML content block.querySelector('.main-body-wrapper').innerHTML += `
@@ -189,7 +191,7 @@ export default async function decorate(block) {
-
2024
+
${currentYear}
Today
diff --git a/scripts/program-calendar.js b/scripts/program-calendar.js index 565056a..f3dbc0c 100644 --- a/scripts/program-calendar.js +++ b/scripts/program-calendar.js @@ -32,7 +32,7 @@ export async function buildCalendar(dataObj, block, type, mappingArray, period) if (deliverables.length === 0) { const calendarTab = document.querySelector('.calendar.tab'); calendarTab.innerHTML = ` -
Required Data is Unavailable.
+
Required Data is Unavailable for this view.
`; return; }