mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 03:35:51 +00:00
correct moment time display
This commit is contained in:
@@ -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')) {
|
||||
|
||||
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user