Skip to content

Commit

Permalink
added project-meetings-check.js file to evaluate the changes in new p…
Browse files Browse the repository at this point in the history
…roject-meetings.js file
  • Loading branch information
innith committed Feb 2, 2025
1 parent aabcf86 commit 8e4d03d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions assets/js/project-meetings-check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { getEventData, insertEventSchedule } from "./utility/api-events.js";
/**
* This type of function is called an IIFE function. The main function is the primarily controller that loads the recurring events on this page.
* Refer: https://developer.mozilla.org/en-US/docs/Glossary/IIFE
*/
(async function main() {
const eventData = await getEventData();

// If the document is still loading, add an EventListener. There is no race conditiion because JavaScript has run-to-completion semantics
if (document.readyState === "loading") {
document.addEventListener(
"DOMContentLoaded",
function () { insertEventSchedule(eventData, "project-meetings") }
);
}

// If the document is not in the loading state, the DOM content has loaded and the event schedule can be populated
else { insertEventSchedule(eventData, "project-meetings") }

//Displays/Inserts the user's time zone in the DOM
document
.querySelector("#userTimeZone")
.insertAdjacentHTML("afterbegin", timeZoneText());
})();

0 comments on commit 8e4d03d

Please sign in to comment.