diff --git a/blocks/events/events.js b/blocks/events/events.js index 875eee4..7431530 100644 --- a/blocks/events/events.js +++ b/blocks/events/events.js @@ -57,8 +57,8 @@ function separateEventsByDate(events, currentDate, classParameter) { const futureEvents = []; const archivedEvents = []; events.forEach((event) => { - const startDate = new Date(event.startdate * 1000); - const endDate = new Date(event.enddate * 1000); + const startDate = new Date((event.startdate - 25569) * 24 * 60 * 60 * 1000); + const endDate = new Date((event.enddate - 25569) * 24 * 60 * 60 * 1000); if (startDate > currentDate || endDate > currentDate) { futureEvents.push(event); @@ -73,8 +73,11 @@ function separateEventsByDate(events, currentDate, classParameter) { async function generateEventDetails(articles) { const articleElements = articles.map((art) => { let date = ''; + const options = { + month: 'short', day: '2-digit', year: 'numeric', timeZone: 'UTC', + }; if (art.startdate && art.enddate) { - const endDate = new Date(art.enddate * 1000).toLocaleDateString('en-Us', { month: 'short', day: '2-digit', year: 'numeric' }); + const endDate = new Date((art.enddate - 25569) * 24 * 60 * 60 * 1000).toLocaleDateString('en-Us', options); const eventDate = art.startdate === art.enddate ? endDate : formatDateRange(art.startdate, art.enddate); date = (art.eventtime !== '') ? `${eventDate} ${art.eventtime}` : eventDate; diff --git a/scripts/scripts.js b/scripts/scripts.js index 58c29f2..9ab1bbc 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -341,9 +341,13 @@ function correctUTMFlow() { } export function formatDateRange(startdate, enddate) { - const options = { month: 'short', day: '2-digit', year: 'numeric' }; - const formattedStartDate = new Date(Number(startdate) * 1000).toLocaleDateString('en-us', options); - const formattedEndDate = new Date(Number(enddate) * 1000).toLocaleDateString('en-us', options); + const options = { + month: 'short', day: '2-digit', year: 'numeric', timeZone: 'UTC', + }; + const startDate = new Date(Number(startdate - 25569) * 24 * 60 * 60 * 1000).toUTCString(); + const endDate = new Date(Number(enddate - 25569) * 24 * 60 * 60 * 1000).toUTCString(); + const formattedStartDate = new Date(startDate).toLocaleDateString('en-us', options); + const formattedEndDate = new Date(endDate).toLocaleDateString('en-us', options); const startYear = new Date(formattedStartDate).getFullYear(); const endYear = new Date(formattedEndDate).getFullYear(); const differentYear = startYear !== endYear; diff --git a/styles/list.css b/styles/list.css index 4bd9744..9ea49ff 100644 --- a/styles/list.css +++ b/styles/list.css @@ -101,11 +101,8 @@ ul.keyword-list { list-style: none; } -ul li { - padding: 0 !important; -} - ul.keyword-list li { + padding: 0; display: inline-block; margin-right: 10px; position: relative; @@ -134,7 +131,7 @@ ul.keyword-list li:not(:last-of-type)::after { .list > .items > .item > .image img { max-width: 100%; - height: 100%; + height: auto; vertical-align: middle; border: 0; aspect-ratio: 16 / 16;