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

This commit is contained in:
Dan Stillman 2016-03-11 03:24:00 -05:00
parent 7a03b1e527
commit 277ddc39f8

View file

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