Skip to content

Commit

Permalink
use current year in initial block, update msg (#161)
Browse files Browse the repository at this point in the history
- main js for details block now programmatically retrieves current year
- updated missing data msg for calendar view
  • Loading branch information
mdickson-adbe authored Aug 21, 2024
1 parent 0793c3e commit 9f5ce3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion blocks/gmo-program-details/gmo-program-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 += `
<div class="tab-wrapper">
Expand Down Expand Up @@ -189,7 +191,7 @@ export default async function decorate(block) {
<img class="right" data-direction="right" src="/icons/chevron-right.svg"></img>
</div>
</div>
<div class="current-year" data-quarter="1" data-year="2024">2024</div>
<div class="current-year" data-quarter="1" data-year="${currentYear}">${currentYear}</div>
</div>
<div class="right-controls">
<div class="today-button">Today</div>
Expand Down
2 changes: 1 addition & 1 deletion scripts/program-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
<div class="no-data-msg">Required Data is Unavailable.</div>
<div class="no-data-msg">Required Data is Unavailable for this view.</div>
`;
return;
}
Expand Down

0 comments on commit 9f5ce3b

Please sign in to comment.