Skip to content

Commit 7b9cde1

Browse files
committed
[Annotation] Fix some timezone issues when getting a date from the date picker (bug 1991584)
1 parent e3a5f61 commit 7b9cde1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/display/annotation_layer.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,14 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
16711671
).valueOf();
16721672
target.step = "";
16731673
} else {
1674+
// Unfortunately, when the date is "2025-09-23", the parser
1675+
// converts it to UTC time which may lead to the date being off by
1676+
// one day depending on the timezone. To workaround this, we
1677+
// append "T00:00" to the date so that it's parsed as local
1678+
// time (bug 1989874).
1679+
if (!value.includes("T")) {
1680+
value = `${value}T00:00`;
1681+
}
16741682
value = new Date(value).valueOf();
16751683
}
16761684
target.type = "text";

0 commit comments

Comments
 (0)