From 5449805cc07130032460e7f9cef74538a47e1f18 Mon Sep 17 00:00:00 2001 From: "Raphael D. Pinheiro" Date: Thu, 4 Jul 2024 21:30:23 +0200 Subject: [PATCH] fix calendar bug --- website/src/lib/components/toolbar/tools/Time.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/src/lib/components/toolbar/tools/Time.svelte b/website/src/lib/components/toolbar/tools/Time.svelte index 6524b633..0b605ab9 100644 --- a/website/src/lib/components/toolbar/tools/Time.svelte +++ b/website/src/lib/components/toolbar/tools/Time.svelte @@ -34,7 +34,7 @@ let speed: number | undefined = undefined; function toCalendarDate(date: Date): CalendarDate { - return new CalendarDate(date.getFullYear(), date.getMonth(), date.getDate()); + return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate()); } const { velocityUnits, distanceUnits } = settings; @@ -83,7 +83,7 @@ return new Date(); } let [hours, minutes, seconds] = time.split(':').map((x) => parseInt(x)); - return new Date(date.year, date.month, date.day, hours, minutes, seconds); + return new Date(date.year, date.month - 1, date.day, hours, minutes, seconds); } function updateEnd() {