Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const utils = {
return 25569 + d.getTime() / (24 * 3600 * 1000) - (date1904 ? 1462 : 0);
},
excelToDate(v, date1904) {
if (!Number.isFinite(v)) return v; // dmjp: If v isn't actually a date, eg the cell style is a date format but the value isn't numeric, then return v instead of "Invalid Date".
// eslint-disable-next-line no-mixed-operators
const millisecondSinceEpoch = Math.round((v - 25569 + (date1904 ? 1462 : 0)) * 24 * 3600 * 1000);
return new Date(millisecondSinceEpoch);
Expand Down