From 9d5d8b525ad1479bfb5ce78a25dbcc3d68ae37e8 Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Mon, 27 Apr 2015 19:32:45 -0500 Subject: [PATCH] Access date in Zotero.Item::toJSON should be in ISO-8601 format --- chrome/content/zotero/xpcom/data/item.js | 4 ++++ chrome/content/zotero/xpcom/utilities_internal.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 8b581594b..242901415 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -4978,6 +4978,10 @@ Zotero.Item.prototype.toJSON = function(options) { name = 'versionNumber'; } + if (name == 'accessDate') { + val = Zotero.Date.dateToISO(Zotero.Date.sqlToDate(val)); + } + obj[name] = val; } } diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index b791190a0..fcbdfdc87 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -431,6 +431,9 @@ Zotero.Utilities.Internal = { // SQL instead of ISO-8601 item.dateAdded = zoteroItem.dateAdded; item.dateModified = zoteroItem.dateModified; + if (item.accessDate) { + item.accessDate = zoteroItem.getField('accessDate'); + } // Map base fields for (let field in item) {