From 861f37e84f5ede2a04b7e03edf9ad804173da576 Mon Sep 17 00:00:00 2001 From: acegoal07 <39467245+acegoal07@users.noreply.github.com> Date: Thu, 9 Jul 2026 09:52:20 +0100 Subject: [PATCH 1/2] Update dailyReport.js - Makes it so instead of that days it grabs tbe reports from the last report till 10:59 (10:59 was chosen to prevent overlaps in reports) --- backend/services/dailyReport/dailyReport.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/services/dailyReport/dailyReport.js b/backend/services/dailyReport/dailyReport.js index 3b8257c..47d3a9d 100644 --- a/backend/services/dailyReport/dailyReport.js +++ b/backend/services/dailyReport/dailyReport.js @@ -6,15 +6,21 @@ const { getDaily } = require('../../endpoints/rota/scheduleLogic'); * @param {import('mongodb').Db} db */ module.exports = async (db) => { - // Get all the reports from today - const startOfDay = new Date().setHours(0, 0, 0, 0); - const endOfDay = new Date().setHours(23, 59, 59, 999); + // Get all the reports since the last daily report + const now = new Date(); + + const start = new Date(now); + start.setDate(start.getDate() - 1); + start.setHours(11, 0, 0, 0); + + const end = new Date(now); + end.setHours(10, 59, 59, 999); // Check to see if a report exists already and if one does exit out const reportExists = await db.collection('overviewReport').findOne({ date: { - $gte: startOfDay, - $lte: endOfDay + $gte: start, + $lte: end } }); From a3d5bc92ec258b46f0a4b0f5d4e2ac2534f23b7a Mon Sep 17 00:00:00 2001 From: acegoal07 <39467245+acegoal07@users.noreply.github.com> Date: Thu, 9 Jul 2026 09:54:07 +0100 Subject: [PATCH 2/2] Update Overview.jsx --- frontend/app/components/Overview.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/components/Overview.jsx b/frontend/app/components/Overview.jsx index aac42c9..d82203a 100644 --- a/frontend/app/components/Overview.jsx +++ b/frontend/app/components/Overview.jsx @@ -250,7 +250,7 @@ export default function Overview() { {report.missing.map((element) => (
{/* Status */}