Update utilities submodule and date-parsing tests

Includes strToDate() fixes
This commit is contained in:
Dan Stillman 2022-06-22 04:36:56 -04:00
parent 9c6d7abc76
commit 5920c5d3e5
3 changed files with 16 additions and 1 deletions

@ -1 +1 @@
Subproject commit 7ecd907641292bc694f6d775e4d0ab933f157d68
Subproject commit dd354a3bf76affbe03e3f360b3ad087fdd16c824

View file

@ -196,6 +196,20 @@ describe("Zotero.Date", function() {
assert.notProperty(o, 'year');
});
it("should parse English month before date", function () {
var o = Zotero.Date.strToDate("June 26, 2010");
assert.equal(o.month, 5);
assert.equal(o.day, 26);
assert.equal(o.year, 2010);
});
it("should parse English month after date", function () {
var o = Zotero.Date.strToDate("26 June 2010");
assert.equal(o.month, 5);
assert.equal(o.day, 26);
assert.equal(o.year, 2010);
});
it("should parse Chinese month", function () {
Zotero.locale = 'zh-CN';
Zotero.Date.init();

View file

@ -93,6 +93,7 @@ describe("Zotero.FeedItem", function () {
describe("#fromJSON()", function() {
it("should attempt to parse non ISO-8601 dates", function* () {
Zotero.locale = 'en-US';
Zotero.Date.init();
var data = [
{
itemType: "journalArticle",