commit 0b384abe66b5fca38049f5a9b39ef62ef1108b4b
parent 53df1b8dae3365363b4e6e4901ff9ae13736f660
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 1 Apr 2018 07:45:11 -0400
Fix DST display bug in Accessed and a few other date fields
If you entered a date that was in DST (including the current date at
00:00:00) but you were in standard time, the previous day was displayed.
Since access dates for saved items include explicit timestamps and most
people don't work between the hours of midnight and 3 a.m., this didn't
come up very often, and it was easy to miss when it did, since you'd be
unlikely to notice it for previously entered dates. (Someone noticed it
today because DST ended in Australia.)
This only affected the item pane, so citations were unaffected.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml
@@ -1308,7 +1308,10 @@
if (date) {
// If no time, interpret as local, not UTC
if (Zotero.Date.isSQLDate(valueText)) {
- date = Zotero.Date.sqlToDate(valueText);
+ // Add time to avoid showing previous day if date is in
+ // DST (including the current date at 00:00:00) and we're
+ // in standard time
+ date = Zotero.Date.sqlToDate(valueText + ' 12:00:00');
valueText = date.toLocaleDateString();
}
else {