From df91425643a1d8209561fcaf720c294125a53809 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 22 Nov 2022 18:39:23 +0530 Subject: [PATCH] fix: correct month after changing time zone (#5635) Co-authored-by: Peer Richelsen --- packages/ui/v2/modules/booker/DatePicker.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/ui/v2/modules/booker/DatePicker.tsx b/packages/ui/v2/modules/booker/DatePicker.tsx index f753406dba..0ddbcda191 100644 --- a/packages/ui/v2/modules/booker/DatePicker.tsx +++ b/packages/ui/v2/modules/booker/DatePicker.tsx @@ -138,9 +138,10 @@ const DatePicker = ({ onMonthChange(browsingDate.add(newMonth, "month")); } }; - const month = browsingDate - ? new Intl.DateTimeFormat(i18n.language, { month: "long" }).format(new Date(browsingDate.toISOString())) + ? new Intl.DateTimeFormat(i18n.language, { month: "long" }).format( + new Date(browsingDate.year(), browsingDate.month()) + ) : null; return (