Add Zotero.Date.isISODate() and Zotero.Date.isoToSQL()

This commit is contained in:
Dan Stillman 2015-04-29 17:26:05 -04:00
parent e8d4b3e840
commit 322339876e
2 changed files with 26 additions and 2 deletions

11
test/tests/dateTest.js Normal file
View file

@ -0,0 +1,11 @@
describe("Zotero.Date", function() {
describe("#isISODate()", function () {
it("should determine whether a date is an ISO 8601 date", function () {
assert.ok(Zotero.Date.isISODate("2015"));
assert.ok(Zotero.Date.isISODate("2015-04"));
assert.ok(Zotero.Date.isISODate("2015-04-29"));
assert.ok(Zotero.Date.isISODate("2015-04-29T17:28Z"));
assert.isFalse(Zotero.Date.isISODate("2015-04-29 17:28"));
})
})
})