Don't include dateAdded/dateModified in item JSON if not set
This commit is contained in:
parent
7a03b1e527
commit
277ddc39f8
1 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue