diff --git a/chrome/content/zotero/xpcom/utilities b/chrome/content/zotero/xpcom/utilities index a0a145a4b5..e4a8d2695c 160000 --- a/chrome/content/zotero/xpcom/utilities +++ b/chrome/content/zotero/xpcom/utilities @@ -1 +1 @@ -Subproject commit a0a145a4b534721148da362a3bae3befc8d65121 +Subproject commit e4a8d2695c34ab7977fcf2a73720546c1c43560c diff --git a/test/tests/dateTest.js b/test/tests/dateTest.js index 5d6ba7520c..6dcf84d2b2 100644 --- a/test/tests/dateTest.js +++ b/test/tests/dateTest.js @@ -164,6 +164,13 @@ describe("Zotero.Date", function() { }) describe("#strToDate()", function () { + beforeEach(function () { + if (Zotero.locale != 'en-US') { + Zotero.locale = 'en-US'; + Zotero.Date.init(); + } + }); + it("should return object without date parts for null", function () { var o = Zotero.Date.strToDate(null); assert.notProperty(o, 'year'); @@ -189,6 +196,15 @@ describe("Zotero.Date", function() { assert.notProperty(o, 'year'); }); + it("should parse Chinese month", function () { + Zotero.locale = 'zh-CN'; + Zotero.Date.init(); + var o = Zotero.Date.strToDate("四月 26, 2010"); + assert.equal(o.month, 3); + assert.equal(o.day, 26); + assert.equal(o.year, 2010); + }); + it("should parse two- and three-digit dates with leading zeros", function () { var o;