Merge pull request #20320 from calixteman/bug1991584

[Annotation] Fix some timezone issues when getting a date from the date picker (bug 1991584)
This commit is contained in:
calixteman 2025-10-01 00:41:17 -11:00 committed by GitHub
commit 042e821bec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1737,6 +1737,14 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
).valueOf();
target.step = "";
} else {
// Unfortunately, when the date is "2025-09-23", the parser
// converts it to UTC time which may lead to the date being off by
// one day depending on the timezone. To workaround this, we
// append "T00:00" to the date so that it's parsed as local
// time (bug 1989874).
if (!value.includes("T")) {
value = `${value}T00:00`;
}
value = new Date(value).valueOf();
}
target.type = "text";