Skip to content

Commit

Permalink
Fix: parsing of date in useGetCalendarDataa
Browse files Browse the repository at this point in the history
  • Loading branch information
georgipavlov-7DIGIT committed Sep 27, 2024
1 parent 5d40d26 commit 43379bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hooks/useGetCalendarData.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ export default function useGetCalendarData(startDate) {
}

const slotsData = [...data.slots, ...data.campaign_slots];

for (let i = 0; i < slotsData.length; i++) {
const slot = slotsData[i];
const slotTime =
typeof slot === "object"
? new Date(parseUTCDate(slotsData[i].time))
: slot.includes("UTC")
? new Date(parseUTCDate(slot))
: new Date(slotsData[i]);

const key = slotTime.toLocaleDateString();
Expand Down

0 comments on commit 43379bf

Please sign in to comment.