From 044b57a813b9d73ae7baa9e84e696d521bf97efd Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 6 Sep 2023 13:32:52 -1000 Subject: [PATCH] Calendar: Fix days offset by one Depending on your timezone and current time, your calendar could show the wrong days (Tuesday -> Monday) --- calendar/js/et2_widget_view.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/calendar/js/et2_widget_view.ts b/calendar/js/et2_widget_view.ts index 7afa9697e8..fabbedefb0 100644 --- a/calendar/js/et2_widget_view.ts +++ b/calendar/js/et2_widget_view.ts @@ -335,9 +335,9 @@ export class et2_calendar_view extends et2_valueWidget // Ymd format: 20000101 date.setFullYear(parseInt(_value.substring(0, 4))); // Avoid overflow into next month since it already has a value - date.setDate(1); - date.setMonth(parseInt(_value.substring(4, 6)) - 1); - date.setDate(parseInt(_value.substring(6, 8))); + date.setUTCDate(1); + date.setUTCMonth(parseInt(_value.substring(4, 6)) - 1); + date.setUTCDate(parseInt(_value.substring(6, 8))); date.setUTCHours(0); date.setUTCMinutes(0); date.setUTCSeconds(0);