From 1d085bcf83858b81c7c0db552cd70906926ddf5d Mon Sep 17 00:00:00 2001 From: irais-valenzuela Date: Wed, 17 Apr 2024 17:24:19 -0700 Subject: [PATCH 1/7] created new files --- .../events-page/right-col-content-check.html | 32 +++++++++++ assets/js/events-check.js | 45 ++++++++++++++++ assets/js/project.js | 7 +++ assets/js/right-col-content-check.js | 25 +++++++++ pages/events-check.html | 54 +++++++++++++++++++ 5 files changed, 163 insertions(+) create mode 100644 _includes/events-page/right-col-content-check.html create mode 100644 assets/js/events-check.js create mode 100644 assets/js/right-col-content-check.js create mode 100644 pages/events-check.html diff --git a/_includes/events-page/right-col-content-check.html b/_includes/events-page/right-col-content-check.html new file mode 100644 index 0000000000..e122fb7d6b --- /dev/null +++ b/_includes/events-page/right-col-content-check.html @@ -0,0 +1,32 @@ +

+ + Online Project Team Meetings +

+
+
+
+ +
+
+

+ Please review the listing of project team meeting times to find a + project that fits your schedule. You are welcome to attend a project + team meeting after you have completed + Onboarding. +

+
+
+
+
+ {% assign days-of-week = + "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday" | split: "," %} + {% for day in days-of-week %} +
+

{{day}}

+
    +
    + {% endfor %} +
    +
    + + diff --git a/assets/js/events-check.js b/assets/js/events-check.js new file mode 100644 index 0000000000..c96648fdff --- /dev/null +++ b/assets/js/events-check.js @@ -0,0 +1,45 @@ +const locationsDropDown = document.querySelector(".getting-started-mobile-page"); +const showingLocations = document.querySelector(".mobile-locations-dropdown"); +const showContent = document.querySelectorAll(".event-title"); +const showLocations = document.querySelector(".event-title-1"); + +showLocations.addEventListener("click", function () { + this.classList.toggle("active"); + if (showingLocations.style.display == "block") { + showingLocations.style.display = "none"; + } else { + showingLocations.style.display = "block"; + } +}); + +for (let i = 0; i < showContent.length; i++) { + showContent[i].addEventListener("click", showingDropDown); +} + +function showingDropDown() { + if(document.body.clientWidth<767){ + this.classList.toggle("active"); + let dropDown = this.nextElementSibling; + if (dropDown.style.display === "block") { + dropDown.style.display = "none"; + } else { + dropDown.style.display = "block"; + } + } +} +document.querySelector('.flex-page-card').addEventListener('resize',handleScreenResize) +function handleScreenResize(){ + if(document.body.clientWidth>767){ + const columns = document.querySelectorAll('.mobile-dropdown'); + for(let column of columns){ + column.style.display='block'; + column.previousElementSibling.classList.remove('active'); + } + } + else{ + const columns = document.querySelectorAll('.mobile-dropdown'); + for(let column of columns){ + column.style.display='none'; + } +} +} \ No newline at end of file diff --git a/assets/js/project.js b/assets/js/project.js index faf755d123..fcb0399b11 100644 --- a/assets/js/project.js +++ b/assets/js/project.js @@ -18,6 +18,7 @@ const project = findProjectById(projectId); function findProjectById(identification){ // Starts at 1 now since the first element is a time stamp + for (let i = 1; i < projects.length; i++){ let itemId = projects[i].id.toString(); if(itemId == identification){ @@ -140,8 +141,12 @@ let meetingsFound = []; // Escapes JSON for injections. See: #2134. If this is no longer the case, perform necessary edits, and remove this comment. const vrmsData = JSON.parse(decodeURIComponent("{{ vrmsData | jsonify | uri_escape }}")); +// me +console.log("vrmsData", vrmsData) + // Helper function to sort VRMS data by day of the week from "date" key and meeting time from "startTime" key function sortByDate(scheduleData) { + console.log("scheduleData", scheduleData) const map = { 'Mon': 1, 'Tue': 2, @@ -181,6 +186,8 @@ function sortByDate(scheduleData) { function appendMeetingTimes(scheduleData) { sortByDate(scheduleData); + //me + console.log("scheduleData ====>", scheduleData) for (const event of scheduleData) { try { diff --git a/assets/js/right-col-content-check.js b/assets/js/right-col-content-check.js new file mode 100644 index 0000000000..372d790167 --- /dev/null +++ b/assets/js/right-col-content-check.js @@ -0,0 +1,25 @@ +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(); + + //Displays/Inserts event schedule to DOM + if (document.readyState === "loading") { + document.addEventListener( + "DOMContentLoaded", + () => { insertEventSchedule(eventData, "events"); } + ); + } + else { + insertEventSchedule(eventData, "events"); + } + + //Displays/Inserts the user's time zone in the DOM + document + .querySelector("#userTimeZone") + .insertAdjacentHTML("afterbegin", timeZoneText()); +})(); \ No newline at end of file diff --git a/pages/events-check.html b/pages/events-check.html new file mode 100644 index 0000000000..27a2881714 --- /dev/null +++ b/pages/events-check.html @@ -0,0 +1,54 @@ +--- +layout: default +title: Events - Hack for LA +permalink: /events-check +--- + + + + + + +
    + {% include events-page/header-container-content.html %} +
    + +
    + +

    Our Events

    +
    +
    + {% include events-page/left-col-content.html %} +
    + +
    + {% include events-page/right-col-content-check.html%} +
    +
    + +

    + Our Locations +

    + +
    +
    +

    + In light of the COVID-19 pandemic, Hack for LA has suspended its in-person + events below. The organization remains fully active, and all events are + now being conducted remotely using Zoom at the days/times listed above. +

    +
    + +
    +

    + + See our Locations +

    +
    +
    + +
    + {% include events-page/our-locations-content.html %} +
    + +
    \ No newline at end of file From 2d7df260c2bd907902a7c1d418d2f0759e5f1d70 Mon Sep 17 00:00:00 2001 From: irais-valenzuela Date: Thu, 25 Apr 2024 15:50:43 -0700 Subject: [PATCH 2/7] created new file to share data fetching code for projects.js and right-col-content.js --- assets/js/utility/vrms-events.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/js/utility/vrms-events.js diff --git a/assets/js/utility/vrms-events.js b/assets/js/utility/vrms-events.js new file mode 100644 index 0000000000..e69de29bb2 From eb6b35ef41913617239181b57465e4e6f0894817 Mon Sep 17 00:00:00 2001 From: irais-valenzuela Date: Mon, 29 Apr 2024 15:26:00 -0700 Subject: [PATCH 3/7] created vrms-event.js and moved sortByDate and timeFomat funcs to that file and call appendMeetingTimes from vrms-events now --- assets/js/project.js | 83 ++------------------------------ assets/js/utility/api-events.js | 2 + assets/js/utility/vrms-events.js | 73 ++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 78 deletions(-) diff --git a/assets/js/project.js b/assets/js/project.js index fcb0399b11..c5ad3e82cc 100644 --- a/assets/js/project.js +++ b/assets/js/project.js @@ -1,13 +1,14 @@ --- --- - /* - Fetch the correct project +Fetch the correct project */ {% assign projects = site.data.external.github-data %} // Escapes JSON for injections. See: #2134. If this is no longer the case, perform necessary edits, and remove this comment. let projects = JSON.parse(decodeURIComponent("{{ projects | jsonify | uri_escape }}")); +import { vrmsDataFetch, timeFormat } from './utility/vrms-events.js'; + /* Passing script attributes from html script tag to JS file https://www.gun.io/blog/pass-arguments-to-embedded-javascript-tutorial-example @@ -136,58 +137,8 @@ let meetingsHeader = document.querySelector('.meetingsHeader'); let projectTitle = scriptTag.getAttribute("projectTitle"); let meetingsFound = []; -// Grab the meeting time data from the vrms_data.json file -{% assign vrmsData = site.data.external.vrms_data %} -// Escapes JSON for injections. See: #2134. If this is no longer the case, perform necessary edits, and remove this comment. -const vrmsData = JSON.parse(decodeURIComponent("{{ vrmsData | jsonify | uri_escape }}")); - -// me -console.log("vrmsData", vrmsData) - -// Helper function to sort VRMS data by day of the week from "date" key and meeting time from "startTime" key -function sortByDate(scheduleData) { - console.log("scheduleData", scheduleData) - const map = { - 'Mon': 1, - 'Tue': 2, - 'Wed': 3, - 'Thu': 4, - 'Fri': 5, - 'Sat': 6, - 'Sun': 7 - }; - - scheduleData.sort(function(a, b) { - const day1 = new Date(a.date).toString().substring(0, 3); - const day2 = new Date(b.date).toString().substring(0, 3); - - return map[day1] - map[day2]; - }); - - scheduleData.sort(function(a, b) { - const day1 = new Date(a.date).toString().substring(0, 3); - const day2 = new Date(b.date).toString().substring(0, 3); - const time1 = new Date(a.startTime).toString().substring(16, 21); - const time2 = new Date(b.startTime).toString().substring(16, 21); - - if (day1 === day2) { - if (time1 > time2) { - return 1; - } else { - return -1; - } - } else { - return 1; - } - }); -} - // Loops through the VRMS data and inserts each meeting time into the HTML of the correct project page function appendMeetingTimes(scheduleData) { - - sortByDate(scheduleData); - //me - console.log("scheduleData ====>", scheduleData) for (const event of scheduleData) { try { @@ -196,6 +147,7 @@ function appendMeetingTimes(scheduleData) { const projectName = event.project.name; const name = event.name; const day = new Date(event.date).toString().substring(0,3); + // only append the meeting times to the correct project page if (projectTitle.toLowerCase() === projectName.toLowerCase()) { meetingsList.insertAdjacentHTML("beforeend", `
  • ${day} ${startTime} - ${endTime}
    ${name}
  • `); @@ -208,35 +160,10 @@ function appendMeetingTimes(scheduleData) { } } -appendMeetingTimes(vrmsData); - +vrmsDataFetch("project", appendMeetingTimes) if (meetingsFound.length >= 1) { meetingsHeader.insertAdjacentHTML("beforeend", 'Meetings'); document.querySelector('#userTimeZone').insertAdjacentHTML('afterbegin', timeZoneText()); -} - -// Formats time to be readable -function timeFormat(time) { - let hours = time.getHours(); - let minutes = time.getMinutes(); - - if (minutes == 0) { - minutes = minutes + "0"; - } - - if (hours < 12) { - return `${hours}:${minutes} am`; - } - else if (hours > 12){ - hours = hours - 12; - return `${hours}:${minutes} pm`; - } - else if (hours = 12){ - return `${hours}:${minutes} pm`; - } else { - return `${hours}:${minutes} am`; - } - } \ No newline at end of file diff --git a/assets/js/utility/api-events.js b/assets/js/utility/api-events.js index 09398dabff..e54c5c8541 100644 --- a/assets/js/utility/api-events.js +++ b/assets/js/utility/api-events.js @@ -21,6 +21,8 @@ async function getEventData() { * @param {String} page - page that is using eventData ("events" or "project-meetings") */ function insertEventSchedule(eventData, page) { + // me + console.log("eventData", eventData) for (const [key, value] of Object.entries(eventData)) { let placeToInsert = document.querySelector(`#${key}-List`); placeToInsert.innerHTML = ""; diff --git a/assets/js/utility/vrms-events.js b/assets/js/utility/vrms-events.js index e69de29bb2..cb07f1658c 100644 --- a/assets/js/utility/vrms-events.js +++ b/assets/js/utility/vrms-events.js @@ -0,0 +1,73 @@ +--- +--- + +{% assign vrmsData = site.data.external.vrms_data %} +const vrmsData = JSON.parse(decodeURIComponent("{{ vrmsData | jsonify | uri_escape }}")); + +export const vrmsDataFetch = (currentPage, appendMeetingTimes) => { + return sortByDate(vrmsData, currentPage, appendMeetingTimes) +} + + // Helper function to sort VRMS data by day of the week from "date" key and meeting time from "startTime" key + function sortByDate(scheduleData, currentPage, appendMeetingTimes) { + const map = { + 'Mon': 1, + 'Tue': 2, + 'Wed': 3, + 'Thu': 4, + 'Fri': 5, + 'Sat': 6, + 'Sun': 7 + }; + + scheduleData.sort(function(a, b) { + const day1 = new Date(a.date).toString().substring(0, 3); + const day2 = new Date(b.date).toString().substring(0, 3); + + return map[day1] - map[day2]; + }); + + scheduleData.sort(function(a, b) { + const day1 = new Date(a.date).toString().substring(0, 3); + const day2 = new Date(b.date).toString().substring(0, 3); + const time1 = new Date(a.startTime).toString().substring(16, 21); + const time2 = new Date(b.startTime).toString().substring(16, 21); + + if (day1 === day2) { + if (time1 > time2) { + return 1; + } else { + return -1; + } + } else { + return 1; + } + }); + + currentPage === "events" ? scheduleData : appendMeetingTimes(scheduleData) +} + + +// Formats time to be readable +export function timeFormat(time) { + let hours = time.getHours(); + let minutes = time.getMinutes(); + + if (minutes == 0) { + minutes = minutes + "0"; + } + + if (hours < 12) { + return `${hours}:${minutes} am`; + } + else if (hours > 12){ + hours = hours - 12; + return `${hours}:${minutes} pm`; + } + else if (hours = 12){ + return `${hours}:${minutes} pm`; + } else { + return `${hours}:${minutes} am`; + } + +} \ No newline at end of file From 0f7a0a706f219339d8fba14cf7d97f6a9d7e54df Mon Sep 17 00:00:00 2001 From: irais-valenzuela Date: Mon, 29 Apr 2024 16:01:45 -0700 Subject: [PATCH 4/7] right-col-content.js also gets event data from vrms-event.jsand is formatted and inserted in right-col-content.js --- assets/js/right-col-content.js | 159 +++++++++++++++++- assets/js/utility/api-events.js | 279 ++++++++++++++++--------------- assets/js/utility/vrms-events.js | 12 +- 3 files changed, 302 insertions(+), 148 deletions(-) diff --git a/assets/js/right-col-content.js b/assets/js/right-col-content.js index 372d790167..bfee84a538 100644 --- a/assets/js/right-col-content.js +++ b/assets/js/right-col-content.js @@ -1,11 +1,10 @@ -import { getEventData, insertEventSchedule } from "./utility/api-events.js"; - +import { vrmsDataFetch } from "./utility/vrms-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(); +(function main() { + const eventData = vrmsDataFetch("events") //Displays/Inserts event schedule to DOM if (document.readyState === "loading") { @@ -22,4 +21,154 @@ import { getEventData, insertEventSchedule } from "./utility/api-events.js"; document .querySelector("#userTimeZone") .insertAdjacentHTML("afterbegin", timeZoneText()); -})(); \ No newline at end of file +})(); + +/** + * Inserts the recurring events into the html + * @param {Object} eventData - An array objects of the type returned by displayObject() + * @param {String} page - page that is using eventData ("events" or "project-meetings") + */ +function insertEventSchedule(eventData, page) { + + const formatedEvents = formatEventData(eventData) + + for (const [key, value] of Object.entries(formatedEvents)) { + let placeToInsert = document.querySelector(`#${key}-List`); + placeToInsert.innerHTML = ""; + // check if the day has any events + if (!value.length) { + placeToInsert.insertAdjacentHTML( + "beforeend", + `
  • There are no meetings scheduled.
  • ` + ); + } else { + value.forEach((event) => { + if (event) { + // If a project doesn't have an hflaWebsiteUrl, redirect to the project's Github page + if (event.hflaWebsiteUrl == "") { + event.hflaWebsiteUrl = event.githubUrl + } + let eventHtml; + // insert the correct html for the current page + if (page === "events") { + eventHtml = `
  • ${event.start} - ${event.end}
  • ${event.name} ${event.meetingName}
  • `; + } else { + if(event.dsc != "") event.meetingName += ", "; + eventHtml = `
  • ${event.start} - ${event.end} ${event.name} ${event.meetingName} ${event.dsc}
  • `; + } + placeToInsert.insertAdjacentHTML("beforeend", eventHtml);} + }); + } + } + } + + /** + * Formats event data + * @param {Object} data - array of event objects + * @return {Object} filtered and sorted data + */ + function formatEventData(data) { + const filteredData = filterDataFromApi(data); + const sortedData = sortData(filteredData); + return sortedData; + } + + /** + * Filters out the needed data from the api endpoint + */ + function filterDataFromApi(responseData) { + const return_obj = { + Monday: [], + Tuesday: [], + Wednesday: [], + Thursday: [], + Friday: [], + Saturday: [], + Sunday: [], + }; + responseData.forEach((item) => { + let day_of_week = getDayString(item.date); + return_obj[day_of_week].push(display_object(item)); + }); + return return_obj; + } + + /** + * Sorts Filtered Date from the api end point by their start time + */ + function sortData(filteredData) { + for (const [key, value] of Object.entries(filteredData)) { + value.sort(function (a, b) { + return convertTime12to24(a.start) - convertTime12to24(b.start) || a.name.localeCompare(b.name); + }); + } + return filteredData; + } + + /** + * @param {Date} time - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" + * @return {String} - A time string formatted in the 12 hour format and converted to your timezone. Example: "10:00 pm" + */ + function localeTimeIn12Format(time) { + return new Date(time) + .toLocaleTimeString( + {}, + { + timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, + hour12: true, + hour: "numeric", + minute: "numeric", + } + ) + .toLowerCase(); + } + + /** + * @param {Date} date - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" + * @return {String} - The name of the day represented by the time string. Example 2020-05-13 was a wednesday. I.e rv = 'Wednesday' + */ + function getDayString(date) { + let new_date = new Date(date); + let weekday = new_date.getDay(); + let options = { weekday: "long" }; + return new Intl.DateTimeFormat("en-US", options).format(new_date); + } + + /** + * Given a time string of 12 hour format like '06:00 pm' returns the integer of that string in 24 hour format -> 0600 + * @param {String} time12h - A 12 hour format time string + * @return {Integer} An integer representing the input time string in 24 hour format + */ + function convertTime12to24(time12h) { + const [time, modifier] = time12h.split(" "); + + let [hours, minutes] = time.split(":"); + + if (hours === "12") { + hours = "00"; + } + + if (modifier.toLowerCase() === "pm") { + hours = parseInt(hours, 10) + 12; + } + return parseInt(`${hours}${minutes}`); + } + + /** + * Function that represent the individual object extracted from the api + */ + function display_object(item) { + if (item?.project?.name !== "Hack4LA" && !/^Test\b/i.test(item?.project?.name)) { + const rv_object = { + meetingName: item.name, + name: item.project.name, + dsc: item.description, + start: localeTimeIn12Format(item.startTime), + end: localeTimeIn12Format(item.endTime), + hflaWebsiteUrl: item.project.hflaWebsiteUrl, + githubUrl: item.project.githubUrl, + }; + return rv_object; + } + } + \ No newline at end of file diff --git a/assets/js/utility/api-events.js b/assets/js/utility/api-events.js index e54c5c8541..70c8afee14 100644 --- a/assets/js/utility/api-events.js +++ b/assets/js/utility/api-events.js @@ -15,152 +15,155 @@ async function getEventData() { } } -/** - * Inserts the recurring events into the html - * @param {Object} eventData - An array objects of the type returned by displayObject() - * @param {String} page - page that is using eventData ("events" or "project-meetings") - */ -function insertEventSchedule(eventData, page) { - // me - console.log("eventData", eventData) - for (const [key, value] of Object.entries(eventData)) { - let placeToInsert = document.querySelector(`#${key}-List`); - placeToInsert.innerHTML = ""; - // check if the day has any events - if (!value.length) { - placeToInsert.insertAdjacentHTML( - "beforeend", - `
  • There are no meetings scheduled.
  • ` - ); - } else { - value.forEach((event) => { - if (event) { - // If a project doesn't have an hflaWebsiteUrl, redirect to the project's Github page - if (event.hflaWebsiteUrl == "") { - event.hflaWebsiteUrl = event.githubUrl - } - let eventHtml; - // insert the correct html for the current page - if (page === "events") { - eventHtml = `
  • ${event.start} - ${event.end}
  • ${event.name} ${event.meetingName}
  • `; - } else { - if(event.dsc != "") event.meetingName += ", "; - eventHtml = `
  • ${event.start} - ${event.end} ${event.name} ${event.meetingName} ${event.dsc}
  • `; - } - placeToInsert.insertAdjacentHTML("beforeend", eventHtml);} - }); - } - } -} +// The commented code was moved over to right-col-content.js since this file won't be used anymore. Leaving it here just in case ppl want to leave it here instead. -/** - * Formats event data - * @param {Object} data - array of event objects - * @return {Object} filtered and sorted data - */ -function formatEventData(data) { - const filteredData = filterDataFromApi(data); - const sortedData = sortData(filteredData); - return sortedData; -} +// /** +// * Inserts the recurring events into the html +// * @param {Object} eventData - An array objects of the type returned by displayObject() +// * @param {String} page - page that is using eventData ("events" or "project-meetings") +// */ +// function insertEventSchedule(eventData, page) { -/** - * Filters out the needed data from the api endpoint - */ -function filterDataFromApi(responseData) { - const return_obj = { - Monday: [], - Tuesday: [], - Wednesday: [], - Thursday: [], - Friday: [], - Saturday: [], - Sunday: [], - }; - responseData.forEach((item) => { - let day_of_week = getDayString(item.date); - return_obj[day_of_week].push(display_object(item)); - }); - return return_obj; -} +// const formatedEvents = formatEventData(eventData) -/** - * Sorts Filtered Date from the api end point by their start time - */ -function sortData(filteredData) { - for (const [key, value] of Object.entries(filteredData)) { - value.sort(function (a, b) { - return convertTime12to24(a.start) - convertTime12to24(b.start) || a.name.localeCompare(b.name); - }); - } - return filteredData; -} +// for (const [key, value] of Object.entries(formatedEvents)) { +// let placeToInsert = document.querySelector(`#${key}-List`); +// placeToInsert.innerHTML = ""; +// // check if the day has any events +// if (!value.length) { +// placeToInsert.insertAdjacentHTML( +// "beforeend", +// `
  • There are no meetings scheduled.
  • ` +// ); +// } else { +// value.forEach((event) => { +// if (event) { +// // If a project doesn't have an hflaWebsiteUrl, redirect to the project's Github page +// if (event.hflaWebsiteUrl == "") { +// event.hflaWebsiteUrl = event.githubUrl +// } +// let eventHtml; +// // insert the correct html for the current page +// if (page === "events") { +// eventHtml = `
  • ${event.start} - ${event.end}
  • ${event.name} ${event.meetingName}
  • `; +// } else { +// if(event.dsc != "") event.meetingName += ", "; +// eventHtml = `
  • ${event.start} - ${event.end} ${event.name} ${event.meetingName} ${event.dsc}
  • `; +// } +// placeToInsert.insertAdjacentHTML("beforeend", eventHtml);} +// }); +// } +// } +// } -/** - * @param {Date} time - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" - * @return {String} - A time string formatted in the 12 hour format and converted to your timezone. Example: "10:00 pm" - */ -function localeTimeIn12Format(time) { - return new Date(time) - .toLocaleTimeString( - {}, - { - timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, - hour12: true, - hour: "numeric", - minute: "numeric", - } - ) - .toLowerCase(); -} +// /** +// * Formats event data +// * @param {Object} data - array of event objects +// * @return {Object} filtered and sorted data +// */ +// function formatEventData(data) { +// const filteredData = filterDataFromApi(data); +// const sortedData = sortData(filteredData); +// return sortedData; +// } -/** - * @param {Date} date - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" - * @return {String} - The name of the day represented by the time string. Example 2020-05-13 was a wednesday. I.e rv = 'Wednesday' - */ -function getDayString(date) { - let new_date = new Date(date); - let weekday = new_date.getDay(); - let options = { weekday: "long" }; - return new Intl.DateTimeFormat("en-US", options).format(new_date); -} +// /** +// * Filters out the needed data from the api endpoint +// */ +// function filterDataFromApi(responseData) { +// const return_obj = { +// Monday: [], +// Tuesday: [], +// Wednesday: [], +// Thursday: [], +// Friday: [], +// Saturday: [], +// Sunday: [], +// }; +// responseData.forEach((item) => { +// let day_of_week = getDayString(item.date); +// return_obj[day_of_week].push(display_object(item)); +// }); +// return return_obj; +// } -/** - * Given a time string of 12 hour format like '06:00 pm' returns the integer of that string in 24 hour format -> 0600 - * @param {String} time12h - A 12 hour format time string - * @return {Integer} An integer representing the input time string in 24 hour format - */ -function convertTime12to24(time12h) { - const [time, modifier] = time12h.split(" "); +// /** +// * Sorts Filtered Date from the api end point by their start time +// */ +// function sortData(filteredData) { +// for (const [key, value] of Object.entries(filteredData)) { +// value.sort(function (a, b) { +// return convertTime12to24(a.start) - convertTime12to24(b.start) || a.name.localeCompare(b.name); +// }); +// } +// return filteredData; +// } - let [hours, minutes] = time.split(":"); +// /** +// * @param {Date} time - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" +// * @return {String} - A time string formatted in the 12 hour format and converted to your timezone. Example: "10:00 pm" +// */ +// function localeTimeIn12Format(time) { +// return new Date(time) +// .toLocaleTimeString( +// {}, +// { +// timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, +// hour12: true, +// hour: "numeric", +// minute: "numeric", +// } +// ) +// .toLowerCase(); +// } - if (hours === "12") { - hours = "00"; - } +// /** +// * @param {Date} date - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" +// * @return {String} - The name of the day represented by the time string. Example 2020-05-13 was a wednesday. I.e rv = 'Wednesday' +// */ +// function getDayString(date) { +// let new_date = new Date(date); +// let weekday = new_date.getDay(); +// let options = { weekday: "long" }; +// return new Intl.DateTimeFormat("en-US", options).format(new_date); +// } - if (modifier.toLowerCase() === "pm") { - hours = parseInt(hours, 10) + 12; - } - return parseInt(`${hours}${minutes}`); -} +// /** +// * Given a time string of 12 hour format like '06:00 pm' returns the integer of that string in 24 hour format -> 0600 +// * @param {String} time12h - A 12 hour format time string +// * @return {Integer} An integer representing the input time string in 24 hour format +// */ +// function convertTime12to24(time12h) { +// const [time, modifier] = time12h.split(" "); -/** - * Function that represent the individual object extracted from the api - */ -function display_object(item) { - if (item?.project?.name !== "Hack4LA" && !/^Test\b/i.test(item?.project?.name)) { - const rv_object = { - meetingName: item.name, - name: item.project.name, - dsc: item.description, - start: localeTimeIn12Format(item.startTime), - end: localeTimeIn12Format(item.endTime), - hflaWebsiteUrl: item.project.hflaWebsiteUrl, - githubUrl: item.project.githubUrl, - }; - return rv_object; - } -} +// let [hours, minutes] = time.split(":"); + +// if (hours === "12") { +// hours = "00"; +// } + +// if (modifier.toLowerCase() === "pm") { +// hours = parseInt(hours, 10) + 12; +// } +// return parseInt(`${hours}${minutes}`); +// } + +// /** +// * Function that represent the individual object extracted from the api +// */ +// function display_object(item) { +// if (item?.project?.name !== "Hack4LA" && !/^Test\b/i.test(item?.project?.name)) { +// const rv_object = { +// meetingName: item.name, +// name: item.project.name, +// dsc: item.description, +// start: localeTimeIn12Format(item.startTime), +// end: localeTimeIn12Format(item.endTime), +// hflaWebsiteUrl: item.project.hflaWebsiteUrl, +// githubUrl: item.project.githubUrl, +// }; +// return rv_object; +// } +// } -export { getEventData, insertEventSchedule }; +// export { getEventData, insertEventSchedule }; diff --git a/assets/js/utility/vrms-events.js b/assets/js/utility/vrms-events.js index cb07f1658c..5e1366adb0 100644 --- a/assets/js/utility/vrms-events.js +++ b/assets/js/utility/vrms-events.js @@ -8,7 +8,7 @@ export const vrmsDataFetch = (currentPage, appendMeetingTimes) => { return sortByDate(vrmsData, currentPage, appendMeetingTimes) } - // Helper function to sort VRMS data by day of the week from "date" key and meeting time from "startTime" key + // Helper function used for project.html and right-col-content.html to sort VRMS data by day of the week from "date" key and meeting time from "startTime" key function sortByDate(scheduleData, currentPage, appendMeetingTimes) { const map = { 'Mon': 1, @@ -43,12 +43,13 @@ export const vrmsDataFetch = (currentPage, appendMeetingTimes) => { return 1; } }); - - currentPage === "events" ? scheduleData : appendMeetingTimes(scheduleData) + + if (currentPage === "events") return scheduleData + else if (currentPage === "project") appendMeetingTimes(scheduleData) } -// Formats time to be readable +// Formats time to be readable for projects.html page export function timeFormat(time) { let hours = time.getHours(); let minutes = time.getMinutes(); @@ -70,4 +71,5 @@ export function timeFormat(time) { return `${hours}:${minutes} am`; } -} \ No newline at end of file +} + From faac9a00d7d6598ea827ae848651e4d3fc94dd6b Mon Sep 17 00:00:00 2001 From: irais-valenzuela Date: Fri, 3 May 2024 14:04:14 -0700 Subject: [PATCH 5/7] sortByDate function is being shared between project.js and right-col-content.js to sort vrmsData but lives on vrmsEvents.js --- assets/js/right-col-content.js | 57 ++++++++------------------------ assets/js/utility/vrms-events.js | 4 +++ 2 files changed, 17 insertions(+), 44 deletions(-) diff --git a/assets/js/right-col-content.js b/assets/js/right-col-content.js index bfee84a538..9f6e34ac0a 100644 --- a/assets/js/right-col-content.js +++ b/assets/js/right-col-content.js @@ -49,14 +49,15 @@ function insertEventSchedule(eventData, page) { event.hflaWebsiteUrl = event.githubUrl } let eventHtml; - // insert the correct html for the current page - if (page === "events") { - eventHtml = `
  • ${event.start} - ${event.end}
  • ${event.name} ${event.meetingName}
  • `; - } else { + // insert the correct html for the current page + if (page === "events") { + eventHtml = `
  • ${event.start} - ${event.end}
  • ${event.name} ${event.meetingName}
  • `; + } else { if(event.dsc != "") event.meetingName += ", "; - eventHtml = `
  • ${event.start} - ${event.end} ${event.name} ${event.meetingName} ${event.dsc}
  • `; - } - placeToInsert.insertAdjacentHTML("beforeend", eventHtml);} + eventHtml = `
  • ${event.start} - ${event.end} ${event.name} ${event.meetingName} ${event.dsc}
  • `; + } + placeToInsert.insertAdjacentHTML("beforeend", eventHtml); + } }); } } @@ -69,12 +70,12 @@ function insertEventSchedule(eventData, page) { */ function formatEventData(data) { const filteredData = filterDataFromApi(data); - const sortedData = sortData(filteredData); - return sortedData; + return filteredData + } /** - * Filters out the needed data from the api endpoint + * Filters out the needed data from the vrmsData return from vrmsDataFetch */ function filterDataFromApi(responseData) { const return_obj = { @@ -92,19 +93,7 @@ function insertEventSchedule(eventData, page) { }); return return_obj; } - - /** - * Sorts Filtered Date from the api end point by their start time - */ - function sortData(filteredData) { - for (const [key, value] of Object.entries(filteredData)) { - value.sort(function (a, b) { - return convertTime12to24(a.start) - convertTime12to24(b.start) || a.name.localeCompare(b.name); - }); - } - return filteredData; - } - + /** * @param {Date} time - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" * @return {String} - A time string formatted in the 12 hour format and converted to your timezone. Example: "10:00 pm" @@ -128,32 +117,12 @@ function insertEventSchedule(eventData, page) { * @return {String} - The name of the day represented by the time string. Example 2020-05-13 was a wednesday. I.e rv = 'Wednesday' */ function getDayString(date) { - let new_date = new Date(date); + let new_date = new Date(date); let weekday = new_date.getDay(); let options = { weekday: "long" }; return new Intl.DateTimeFormat("en-US", options).format(new_date); } - /** - * Given a time string of 12 hour format like '06:00 pm' returns the integer of that string in 24 hour format -> 0600 - * @param {String} time12h - A 12 hour format time string - * @return {Integer} An integer representing the input time string in 24 hour format - */ - function convertTime12to24(time12h) { - const [time, modifier] = time12h.split(" "); - - let [hours, minutes] = time.split(":"); - - if (hours === "12") { - hours = "00"; - } - - if (modifier.toLowerCase() === "pm") { - hours = parseInt(hours, 10) + 12; - } - return parseInt(`${hours}${minutes}`); - } - /** * Function that represent the individual object extracted from the api */ diff --git a/assets/js/utility/vrms-events.js b/assets/js/utility/vrms-events.js index 5e1366adb0..28eb578a78 100644 --- a/assets/js/utility/vrms-events.js +++ b/assets/js/utility/vrms-events.js @@ -4,6 +4,10 @@ {% assign vrmsData = site.data.external.vrms_data %} const vrmsData = JSON.parse(decodeURIComponent("{{ vrmsData | jsonify | uri_escape }}")); +/* vrmsDataFetch calls sortByDate function and passes vrmsData variable, current page which can either be "events" for the right-col-content.html page or +"project" from the project.html page, and passes the appendMeetingTimes function from projects.js that appends the sorted vrmsData +returned by sortByDate to project.html. AppendMeetingTimes is only called if vrmsDataFetch is being called from project.js for the project.html page +*/ export const vrmsDataFetch = (currentPage, appendMeetingTimes) => { return sortByDate(vrmsData, currentPage, appendMeetingTimes) } From c7fcb076b25f1073ab807c8641f81bc4771b2bb0 Mon Sep 17 00:00:00 2001 From: irais-valenzuela Date: Fri, 3 May 2024 16:45:13 -0700 Subject: [PATCH 6/7] both project.js and right-col-content.js share time formatting function stored in vrms-events.js --- assets/js/project.js | 8 +++--- assets/js/right-col-content.js | 26 +++----------------- assets/js/utility/vrms-events.js | 42 ++++++++++++++------------------ 3 files changed, 25 insertions(+), 51 deletions(-) diff --git a/assets/js/project.js b/assets/js/project.js index c5ad3e82cc..797fc008de 100644 --- a/assets/js/project.js +++ b/assets/js/project.js @@ -7,7 +7,7 @@ Fetch the correct project // Escapes JSON for injections. See: #2134. If this is no longer the case, perform necessary edits, and remove this comment. let projects = JSON.parse(decodeURIComponent("{{ projects | jsonify | uri_escape }}")); -import { vrmsDataFetch, timeFormat } from './utility/vrms-events.js'; +import { vrmsDataFetch, localeTimeIn12Format } from './utility/vrms-events.js'; /* Passing script attributes from html script tag to JS file @@ -139,11 +139,10 @@ let meetingsFound = []; // Loops through the VRMS data and inserts each meeting time into the HTML of the correct project page function appendMeetingTimes(scheduleData) { - for (const event of scheduleData) { try { - const startTime = timeFormat(new Date(event.startTime)); - const endTime = timeFormat(new Date(event.endTime)); + const startTime = localeTimeIn12Format(event.startTime); + const endTime = localeTimeIn12Format(event.endTime); const projectName = event.project.name; const name = event.name; const day = new Date(event.date).toString().substring(0,3); @@ -153,7 +152,6 @@ function appendMeetingTimes(scheduleData) { meetingsList.insertAdjacentHTML("beforeend", `
  • ${day} ${startTime} - ${endTime}
    ${name}
  • `); meetingsFound.push(day); } - } catch (e) { console.error(e); } diff --git a/assets/js/right-col-content.js b/assets/js/right-col-content.js index 9f6e34ac0a..c74f03337a 100644 --- a/assets/js/right-col-content.js +++ b/assets/js/right-col-content.js @@ -1,4 +1,4 @@ -import { vrmsDataFetch } from "./utility/vrms-events.js" +import { vrmsDataFetch, localeTimeIn12Format } from "./utility/vrms-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 @@ -69,15 +69,15 @@ function insertEventSchedule(eventData, page) { * @return {Object} filtered and sorted data */ function formatEventData(data) { - const filteredData = filterDataFromApi(data); + const filteredData = filterVrmsData(data); return filteredData } /** - * Filters out the needed data from the vrmsData return from vrmsDataFetch + * Filters out the needed data from the vrmsData returned from vrmsDataFetch */ - function filterDataFromApi(responseData) { + function filterVrmsData(responseData) { const return_obj = { Monday: [], Tuesday: [], @@ -93,24 +93,6 @@ function insertEventSchedule(eventData, page) { }); return return_obj; } - - /** - * @param {Date} time - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" - * @return {String} - A time string formatted in the 12 hour format and converted to your timezone. Example: "10:00 pm" - */ - function localeTimeIn12Format(time) { - return new Date(time) - .toLocaleTimeString( - {}, - { - timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, - hour12: true, - hour: "numeric", - minute: "numeric", - } - ) - .toLowerCase(); - } /** * @param {Date} date - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" diff --git a/assets/js/utility/vrms-events.js b/assets/js/utility/vrms-events.js index 28eb578a78..a44b710f3b 100644 --- a/assets/js/utility/vrms-events.js +++ b/assets/js/utility/vrms-events.js @@ -52,28 +52,22 @@ export const vrmsDataFetch = (currentPage, appendMeetingTimes) => { else if (currentPage === "project") appendMeetingTimes(scheduleData) } - -// Formats time to be readable for projects.html page -export function timeFormat(time) { - let hours = time.getHours(); - let minutes = time.getMinutes(); - - if (minutes == 0) { - minutes = minutes + "0"; - } - - if (hours < 12) { - return `${hours}:${minutes} am`; - } - else if (hours > 12){ - hours = hours - 12; - return `${hours}:${minutes} pm`; - } - else if (hours = 12){ - return `${hours}:${minutes} pm`; - } else { - return `${hours}:${minutes} am`; - } - -} +/** + * @param {Date} time - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" + * @return {String} - A time string formatted in the 12 hour format and converted to your timezone. Example: "10:00 pm" +*/ +// Formats time to be readable for projects.html and right-col-content.html page +export function localeTimeIn12Format(time) { + return new Date(time) + .toLocaleTimeString( + {}, + { + timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, + hour12: true, + hour: "numeric", + minute: "numeric", + } + ) + .toLowerCase(); + } From e1908114b345ba01b724a91717bd254bb67f2a76 Mon Sep 17 00:00:00 2001 From: irais-valenzuela Date: Mon, 6 May 2024 11:39:04 -0700 Subject: [PATCH 7/7] restored code in api-event.js for right-col-content-check.js to use --- assets/js/utility/api-events.js | 256 ++++++++++++++------------------ 1 file changed, 115 insertions(+), 141 deletions(-) diff --git a/assets/js/utility/api-events.js b/assets/js/utility/api-events.js index 05f167a244..2cf765f297 100644 --- a/assets/js/utility/api-events.js +++ b/assets/js/utility/api-events.js @@ -15,46 +15,73 @@ async function getEventData() { } } -// The commented code was moved over to right-col-content.js since this file won't be used anymore. Leaving it here just in case ppl want to leave it here instead. +/** + * Inserts the recurring events into the html + * @param {Object} eventData - An array objects of the type returned by displayObject() + * @param {String} page - page that is using eventData ("events" or "project-meetings") + */ +function insertEventSchedule(eventData, page) { + for (const [key, value] of Object.entries(eventData)) { + let placeToInsert = document.querySelector(`#${key}-List`); + placeToInsert.innerHTML = ""; + // check if the day has any events + if (!value.length) { + placeToInsert.insertAdjacentHTML( + "beforeend", + `
  • There are no meetings scheduled.
  • ` + ); + } else { + value.forEach((event) => { + if (event) { + // If a project doesn't have an hflaWebsiteUrl, redirect to the project's Github page + if (event.hflaWebsiteUrl == "") { + event.hflaWebsiteUrl = event.githubUrl + } + let eventHtml; + // insert the correct html for the current page + if (page === "events") { + eventHtml = `
  • ${event.start} - ${event.end}
  • ${event.name} ${event.meetingName}
  • `; + } else { + if(event.dsc != "") event.meetingName += ", "; + eventHtml = `
  • ${event.start} - ${event.end} ${event.name} ${event.meetingName} ${event.dsc}
  • `; + } + placeToInsert.insertAdjacentHTML("beforeend", eventHtml);} + }); + } + } +} -// /** -// * Inserts the recurring events into the html -// * @param {Object} eventData - An array objects of the type returned by displayObject() -// * @param {String} page - page that is using eventData ("events" or "project-meetings") -// */ -// function insertEventSchedule(eventData, page) { +/** + * Formats event data + * @param {Object} data - array of event objects + * @return {Object} filtered and sorted data + */ +function formatEventData(data) { + const filteredData = filterDataFromApi(data); + const sortedData = sortData(filteredData); + return sortedData; +} -// const formatedEvents = formatEventData(eventData) +/** + * Filters out the needed data from the api endpoint + */ +function filterDataFromApi(responseData) { + const return_obj = { + Monday: [], + Tuesday: [], + Wednesday: [], + Thursday: [], + Friday: [], + Saturday: [], + Sunday: [], + }; + responseData.forEach((item) => { + let day_of_week = getDayString(item.date); + return_obj[day_of_week].push(display_object(item)); + }); + return return_obj; +} -// for (const [key, value] of Object.entries(formatedEvents)) { -// let placeToInsert = document.querySelector(`#${key}-List`); -// placeToInsert.innerHTML = ""; -// // check if the day has any events -// if (!value.length) { -// placeToInsert.insertAdjacentHTML( -// "beforeend", -// `
  • There are no meetings scheduled.
  • ` -// ); -// } else { -// value.forEach((event) => { -// if (event) { -// // If a project doesn't have an hflaWebsiteUrl, redirect to the project's Github page -// if (event.hflaWebsiteUrl == "") { -// event.hflaWebsiteUrl = event.githubUrl -// } -// let eventHtml; -// // insert the correct html for the current page -// if (page === "events") { -// eventHtml = `
  • ${event.start} - ${event.end}
  • ${event.name} ${event.meetingName}
  • `; -// } else { -// if(event.dsc != "") event.meetingName += ", "; -// eventHtml = `
  • ${event.start} - ${event.end} ${event.name} ${event.meetingName} ${event.dsc}
  • `; -// } -// placeToInsert.insertAdjacentHTML("beforeend", eventHtml);} -// }); -// } -// } -// } /** * Sorts Filtered Date from the api end point by their start time */ @@ -67,36 +94,24 @@ function sortData(filteredData) { return filteredData; } -// /** -// * Formats event data -// * @param {Object} data - array of event objects -// * @return {Object} filtered and sorted data -// */ -// function formatEventData(data) { -// const filteredData = filterDataFromApi(data); -// const sortedData = sortData(filteredData); -// return sortedData; -// } +/** + * @param {Date} time - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" + * @return {String} - A time string formatted in the 12 hour format and converted to your timezone. Example: "10:00 pm" + */ +function localeTimeIn12Format(time) { + return new Date(time) + .toLocaleTimeString( + {}, + { + timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, + hour12: true, + hour: "numeric", + minute: "numeric", + } + ) + .toLowerCase(); +} -// /** -// * Filters out the needed data from the api endpoint -// */ -// function filterDataFromApi(responseData) { -// const return_obj = { -// Monday: [], -// Tuesday: [], -// Wednesday: [], -// Thursday: [], -// Friday: [], -// Saturday: [], -// Sunday: [], -// }; -// responseData.forEach((item) => { -// let day_of_week = getDayString(item.date); -// return_obj[day_of_week].push(display_object(item)); -// }); -// return return_obj; -// } /** * @param {Date} date - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" * @return {String} - The name of the day represented by the time string. Example 2020-05-13 was a wednesday. I.e rv = 'Wednesday' @@ -107,83 +122,42 @@ function getDayString(date) { return new Intl.DateTimeFormat("en-US", options).format(new_date); } -// /** -// * Sorts Filtered Date from the api end point by their start time -// */ -// function sortData(filteredData) { -// for (const [key, value] of Object.entries(filteredData)) { -// value.sort(function (a, b) { -// return convertTime12to24(a.start) - convertTime12to24(b.start) || a.name.localeCompare(b.name); -// }); -// } -// return filteredData; -// } - -// /** -// * @param {Date} time - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" -// * @return {String} - A time string formatted in the 12 hour format and converted to your timezone. Example: "10:00 pm" -// */ -// function localeTimeIn12Format(time) { -// return new Date(time) -// .toLocaleTimeString( -// {}, -// { -// timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, -// hour12: true, -// hour: "numeric", -// minute: "numeric", -// } -// ) -// .toLowerCase(); -// } - -// /** -// * @param {Date} date - A valid javscript time string. Example: "2020-05-13T02:00:00.000Z" -// * @return {String} - The name of the day represented by the time string. Example 2020-05-13 was a wednesday. I.e rv = 'Wednesday' -// */ -// function getDayString(date) { -// let new_date = new Date(date); -// let weekday = new_date.getDay(); -// let options = { weekday: "long" }; -// return new Intl.DateTimeFormat("en-US", options).format(new_date); -// } - -// /** -// * Given a time string of 12 hour format like '06:00 pm' returns the integer of that string in 24 hour format -> 0600 -// * @param {String} time12h - A 12 hour format time string -// * @return {Integer} An integer representing the input time string in 24 hour format -// */ -// function convertTime12to24(time12h) { -// const [time, modifier] = time12h.split(" "); +/** + * Given a time string of 12 hour format like '06:00 pm' returns the integer of that string in 24 hour format -> 0600 + * @param {String} time12h - A 12 hour format time string + * @return {Integer} An integer representing the input time string in 24 hour format + */ +function convertTime12to24(time12h) { + const [time, modifier] = time12h.split(" "); -// let [hours, minutes] = time.split(":"); + let [hours, minutes] = time.split(":"); -// if (hours === "12") { -// hours = "00"; -// } + if (hours === "12") { + hours = "00"; + } -// if (modifier.toLowerCase() === "pm") { -// hours = parseInt(hours, 10) + 12; -// } -// return parseInt(`${hours}${minutes}`); -// } + if (modifier.toLowerCase() === "pm") { + hours = parseInt(hours, 10) + 12; + } + return parseInt(`${hours}${minutes}`); +} -// /** -// * Function that represent the individual object extracted from the api -// */ -// function display_object(item) { -// if (item?.project?.name !== "Hack4LA" && !/^Test\b/i.test(item?.project?.name)) { -// const rv_object = { -// meetingName: item.name, -// name: item.project.name, -// dsc: item.description, -// start: localeTimeIn12Format(item.startTime), -// end: localeTimeIn12Format(item.endTime), -// hflaWebsiteUrl: item.project.hflaWebsiteUrl, -// githubUrl: item.project.githubUrl, -// }; -// return rv_object; -// } -// } +/** + * Function that represent the individual object extracted from the api + */ +function display_object(item) { + if (item?.project?.name !== "Hack4LA" && !/^Test\b/i.test(item?.project?.name)) { + const rv_object = { + meetingName: item.name, + name: item.project.name, + dsc: item.description, + start: localeTimeIn12Format(item.startTime), + end: localeTimeIn12Format(item.endTime), + hflaWebsiteUrl: item.project.hflaWebsiteUrl, + githubUrl: item.project.githubUrl, + }; + return rv_object; + } +} -// export { getEventData, insertEventSchedule }; \ No newline at end of file +export { getEventData, insertEventSchedule }; \ No newline at end of file