add time
This commit is contained in:
1 parent
ffc132e19a
commit
be582edeeb
2 files changed
+5
-4
No files matched your search
@@ -89,6 +89,7 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
50,
|
50,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
console.log(res.data.data);
|
||||||
setMonitor(res?.data?.data ?? {});
|
setMonitor(res?.data?.data ?? {});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error);
|
logger.error(error);
|
||||||
|
|||||||
@@ -200,11 +200,11 @@ const getMonitorStatsById = async (req) => {
|
|||||||
}, {});
|
}, {});
|
||||||
} else {
|
} else {
|
||||||
groupedChecks = checksForDateRange.reduce((acc, check) => {
|
groupedChecks = checksForDateRange.reduce((acc, check) => {
|
||||||
const day = new Date(check.createdAt).toISOString().split("T")[0]; // Extract the date part
|
const time = new Date(check.createdAt).toISOString().split("T")[0]; // Extract the date part
|
||||||
if (!acc[day]) {
|
if (!acc[time]) {
|
||||||
acc[day] = { day, checks: [] };
|
acc[time] = { time, checks: [] };
|
||||||
}
|
}
|
||||||
acc[day].checks.push(check);
|
acc[time].checks.push(check);
|
||||||
return acc;
|
return acc;
|
||||||
}, {});
|
}, {});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user