www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 277ddc39f892dd4e8a6a7c5130d4fbfb54347f67
parent 7a03b1e527b16a8bd4386a6614426ccdcd3620ea
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 11 Mar 2016 03:24:00 -0500

Don't include dateAdded/dateModified in item JSON if not set

Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -4046,10 +4046,15 @@ Zotero.Item.prototype.toJSON = function (options = {}) { obj.deleted = deleted ? 1 : 0; } - obj.dateAdded = Zotero.Date.sqlToISO8601(this.dateAdded); - obj.dateModified = Zotero.Date.sqlToISO8601(this.dateModified); if (obj.accessDate) obj.accessDate = Zotero.Date.sqlToISO8601(obj.accessDate); + if (this.dateAdded) { + obj.dateAdded = Zotero.Date.sqlToISO8601(this.dateAdded); + } + if (this.dateModified) { + obj.dateModified = Zotero.Date.sqlToISO8601(this.dateModified); + } + return this._postToJSON(env); }