Fix timezone issues

This commit is contained in:
Adria Navarro 2024-05-20 13:09:28 +02:00
parent a74f82a535
commit 5dc75582d9
1 changed files with 1 additions and 1 deletions

View File

@ -166,7 +166,7 @@ export const stringifyDate = (
const offsetForTimezone = (enableTime && ignoreTimezones) || timeOnly
if (offsetForTimezone) {
// Ensure we use the correct offset for the date
const referenceDate = timeOnly ? new Date() : value.toDate()
const referenceDate = value.toDate()
const offset = referenceDate.getTimezoneOffset() * 60000
return new Date(value.valueOf() - offset).toISOString().slice(0, -1)
}