forked from exceljs/exceljs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request exceljs#1328 from mouse9/bug/date-parsing-issue
bug fix can not read property date1904 of undefined
- Loading branch information
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
20 changes: 20 additions & 0 deletions
20
spec/integration/issues/issue-1328-xlsx-worksheet-reader-date.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const ExcelJS = verquire('exceljs'); | ||
const fs = require('fs'); | ||
|
||
|
||
describe('github issues: Date field with cache style', () => { | ||
const rows = []; | ||
beforeEach(() => | ||
new Promise((resolve, reject) => { | ||
const workbookReader = new ExcelJS.stream.xlsx.WorkbookReader(fs.createReadStream('./spec/integration/data/dateIssue.xlsx'), { worksheets: 'emit', styles: 'cache', sharedStrings: 'cache', hyperlinks: 'ignore', entries: 'ignore' }); | ||
workbookReader.read(); | ||
workbookReader.on('worksheet', worksheet => worksheet.on('row', row => rows.push(row.values[1]))); | ||
workbookReader.on('end', resolve); | ||
workbookReader.on('error', reject); | ||
|
||
}) | ||
); | ||
it('issue 1328 - should emit row with Date Object', () => { | ||
expect(rows).that.deep.equals(['Date', new Date('2020-11-20T00:00:00.000Z')]); | ||
}); | ||
}); |