From f925e4fb0a33e11467e167fcc7cebf5e4b496908 Mon Sep 17 00:00:00 2001 From: tfhuhtal Date: Fri, 25 Oct 2024 14:35:45 +0300 Subject: [PATCH] fix deadline --- client/components/Generic/Homepage.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/components/Generic/Homepage.js b/client/components/Generic/Homepage.js index 62520308..103922ce 100644 --- a/client/components/Generic/Homepage.js +++ b/client/components/Generic/Homepage.js @@ -11,6 +11,13 @@ export const PageItem = ({ title, content }) => ( export const DateItem = ({ timestamp, t }) => { const date = new Date(timestamp) + + // Check if the time is 00:00 + if (date.getUTCHours() === 0 && date.getUTCMinutes() === 0) { + // Subtract one minute + date.setUTCMinutes(date.getUTCMinutes() - 1) + } + const year = date.getUTCFullYear() const month = date.getUTCMonth() + 1 // getUTCMonth() returns 0-11 const day = date.getUTCDate()