use the second day to protect the date popup against the effects of time zone changes. (#7567)

Signed-off-by: denis-tingaikin <denis.tingajkin@xored.com>
This commit is contained in:
Denis Tingaikin 2024-12-27 13:33:42 +03:00 committed by GitHub
parent 4214ace603
commit f13469c052
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)