Fix access date without time coming from sync

This commit is contained in:
Dan Stillman 2017-05-11 00:44:37 -04:00
parent a207e388db
commit 60810ea0a0
2 changed files with 28 additions and 9 deletions

View file

@ -1433,6 +1433,20 @@ describe("Zotero.Item", function () {
assert.equal(item.dateModified, '2015-06-07 20:58:00');
})
it("should accept ISO 8601 access date without time", function* () {
var json = {
itemType: "journalArticle",
accessDate: "2015-06-07",
dateAdded: "2015-06-07T20:57:00Z",
dateModified: "2015-06-07T20:58:00Z",
};
var item = new Zotero.Item;
item.fromJSON(json);
assert.equal(item.getField('accessDate'), '2015-06-07');
assert.equal(item.dateAdded, '2015-06-07 20:57:00');
assert.equal(item.dateModified, '2015-06-07 20:58:00');
})
it("should ignore nonISO 8601 dates", function* () {
var json = {
itemType: "journalArticle",