From 09b7fa8a6dbabe991fa194887165181dfe9fda37 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 20 Mar 2019 21:52:57 -0400 Subject: [PATCH] Fix time zone handling of CSL JSON export of date-only access date Since 9c0f5998a3, depending on your timezone the day could be off by one if the access date didn't have a timestamp (so only for manual entries or imports). --- chrome/content/zotero/xpcom/utilities.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index dce942872a..e99f83445b 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1687,9 +1687,9 @@ Zotero.Utilities = { if(date) { // Convert UTC timestamp to local timestamp for access date - if (CSL_DATE_MAPPINGS[variable] == 'accessDate') { + if (CSL_DATE_MAPPINGS[variable] == 'accessDate' && !Zotero.Date.isSQLDate(date)) { // Accept ISO date - if (Zotero.Date.isISODate(date) && !Zotero.Date.isSQLDate(date)) { + if (Zotero.Date.isISODate(date)) { let d = Zotero.Date.isoToDate(date); date = Zotero.Date.dateToSQL(d, true); }