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).
This commit is contained in:
Dan Stillman 2019-03-20 21:52:57 -04:00
parent 03941dafe0
commit 09b7fa8a6d

View file

@ -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);
}