fix: correct month after changing time zone (#5635)

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
Udit Takkar
2022-11-22 13:09:23 +00:00
committed by GitHub
co-authored by Peer Richelsen
parent c98bafcd52
commit df91425643
+3 -2
View File
@@ -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 (