date parsing test based on IE11 bug

This commit is contained in:
Peter Lüderitz 2021-09-17 13:11:42 +02:00
parent 361975f33a
commit 4f154fd0fd
2 changed files with 24 additions and 0 deletions

12
test.js

@ -2367,6 +2367,18 @@ describe('corner cases', function() {
assert.equal(wb.Sheets.Sheet1.A10.f, "'a!b'!A1");
assert.equal(wb.Sheets.Sheet1.A11.f, "'a b'!A1");
});
it('should parse CSV date values with preceding space', function() {
var wb = X.read(
'7, 2018-03-24',
{cellDates: false, dateNF: 'yyyy-mm-dd', type:'string'}
);
var ws = wb.Sheets.Sheet1;
var d = X.SSF.parse_date_code(ws.B1.v);
assert.equal(d.d, 24);
assert.equal(d.m, 3);
assert.equal(d.y, 2018);
assert.equal(ws.B1.w, '2018-03-24');
});
});
describe('encryption', function() {

12
tests/core.js generated

@ -2367,6 +2367,18 @@ describe('corner cases', function() {
assert.equal(wb.Sheets.Sheet1.A10.f, "'a!b'!A1");
assert.equal(wb.Sheets.Sheet1.A11.f, "'a b'!A1");
});
it('should parse CSV date values with preceding space', function() {
var wb = X.read(
'7, 2018-03-24',
{cellDates: false, dateNF: 'yyyy-mm-dd', type:'string'}
);
var ws = wb.Sheets.Sheet1;
var d = X.SSF.parse_date_code(ws.B1.v);
assert.equal(d.d, 24);
assert.equal(d.m, 3);
assert.equal(d.y, 2018);
assert.equal(ws.B1.w, '2018-03-24');
});
});
describe('encryption', function() {