From a1300e851dab8079f13cf191749d49b6a11aabf2 Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Wed, 6 Apr 2022 19:01:07 +0200 Subject: [PATCH] Finally fixing the calendar --- src/components/Calendar.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index 7342c00..baa0eee 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -12,9 +12,12 @@ function daysDifference(date1: Date, date2: Date) { date2 = date1; date1 = tmp; } - console.log("Diff") - console.log(date1) - console.log(date2) + date1 = new Date(date1); + date1.setHours(0); + date1.setMinutes(0); + date2 = new Date(date2); + date2.setHours(0); + date2.setMinutes(0); return Math.ceil((date2.getTime() - date1.getTime()) / 1000 / 60 / 60 / 24); } @@ -86,7 +89,6 @@ const Calendar = ({ secrets }: { secrets: SecretsCalendar }) => { const timeMin = new Date(); timeMin.setHours(timeMin.getHours() - 1); - console.log(timeMin); const params = new URLSearchParams({ orderBy: "startTime", fields: "items(creator,start,summary)",