Send right time

This commit is contained in:
Adria Navarro 2024-05-23 11:33:50 +02:00
parent f6146c4974
commit 2626c1a721
1 changed files with 5 additions and 1 deletions

View File

@ -168,7 +168,11 @@ export const stringifyDate = (
// Ensure we use the correct offset for the date // Ensure we use the correct offset for the date
const referenceDate = value.toDate() const referenceDate = value.toDate()
const offset = referenceDate.getTimezoneOffset() * 60000 const offset = referenceDate.getTimezoneOffset() * 60000
return new Date(value.valueOf() - offset).toISOString().slice(0, -1) const date = new Date(value.valueOf() - offset)
if (timeOnly) {
return date.toISOString().slice(11, 19)
}
return date.toISOString().slice(0, -1)
} }
// For date-only fields, construct a manual timestamp string without a time // For date-only fields, construct a manual timestamp string without a time