changement nom variable
This commit is contained in:
@@ -24,12 +24,12 @@ Calendar() {
|
||||
|
||||
const eventsByDate = useMemo(() => {
|
||||
if (!user?.tasks) return {};
|
||||
return user.tasks.reduce((acc, task) => {
|
||||
if (!task?.start) return acc;
|
||||
return user.tasks.reduce((eventsByDate, task) => {
|
||||
if (!task?.start) return eventsByDate;
|
||||
const dateKey = task.start.split(" ")[0];
|
||||
if (!acc[dateKey]) acc[dateKey] = [];
|
||||
acc[dateKey].push(task);
|
||||
return acc;
|
||||
if (!eventsByDate[dateKey]) eventsByDate[dateKey] = [];
|
||||
eventsByDate[dateKey].push(task);
|
||||
return eventsByDate;
|
||||
}, {});
|
||||
}, [user]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user