diff --git a/community/events.page.tsx b/community/events.page.tsx index ce5178f668..d8ff9d3495 100644 --- a/community/events.page.tsx +++ b/community/events.page.tsx @@ -42,8 +42,8 @@ function categorizeDates(arr) { const upcoming = []; const today = moment().startOf("day"); // Set the time to midnight arr.forEach((obj) => { - const startDate = moment(obj.startDate); // Parse the 'startDate' string into a moment object - const endDate = moment(obj.endDate); // Parse the 'endDate' string into a moment object + const startDate = moment.utc(obj.startDate); // Parse the 'startDate' string into a moment object + const endDate = moment.utc(obj.endDate); // Parse the 'endDate' string into a moment object let clone = { ...obj }; // Determine the date format based on whether startDate and endDate are the same or in the same month if (startDate.isSame(endDate, 'day')) { diff --git a/community/index.page.tsx b/community/index.page.tsx index 74cac45cf4..25a5b07f5f 100644 --- a/community/index.page.tsx +++ b/community/index.page.tsx @@ -25,8 +25,8 @@ const findNearestUpcomingEvent = (events) => { let index; let eventsClone = []; events?.forEach((event, i) => { - const startDate = moment(event.startDate); // Use the updated key `startDate` - const endDate = moment(event.endDate); // Parse the 'endDate' string into a moment object + const startDate = moment.utc(event.startDate); // Use the updated key `startDate` + const endDate = moment.utc(event.endDate); // Parse the 'endDate' string into a moment object const currentDate = moment(); const diff = startDate.diff(currentDate, "days"); let clone = { ...event };