Use String.fromCharCode() to load Chinese characters in strToDate() test

Follow-up to dc045250a6
This commit is contained in:
Dan Stillman 2022-06-09 00:03:02 -04:00
parent 56151a4198
commit 3fb9e2162e
2 changed files with 4 additions and 2 deletions

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

View file

@ -199,7 +199,9 @@ describe("Zotero.Date", function() {
it("should parse Chinese month", function () {
Zotero.locale = 'zh-CN';
Zotero.Date.init();
var o = Zotero.Date.strToDate("四月 26, 2010");
var o = Zotero.Date.strToDate(
String.fromCharCode(0x56DB) + String.fromCharCode(0x6708) + " 26, 2010"
);
assert.equal(o.month, 3);
assert.equal(o.day, 26);
assert.equal(o.year, 2010);