diff --git a/packages/ui/src/components/calendar/DatePopup.svelte b/packages/ui/src/components/calendar/DatePopup.svelte index 307762d726d..bd0a9dfe60d 100644 --- a/packages/ui/src/components/calendar/DatePopup.svelte +++ b/packages/ui/src/components/calendar/DatePopup.svelte @@ -86,7 +86,9 @@ } } const changeMonth = (date: Date): Date => { - return new Date(date.getFullYear(), date.getMonth() + 1, 1) + // We should use the second day to protect the result of the month-shifted against the effects of time zone changes. + const secondDay = 2 + return new Date(date.getFullYear(), date.getMonth() + 1, secondDay) } $: if (viewDate) viewDateSec = changeMonth(viewDate)