Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
catamphetamine committed Feb 15, 2023
1 parent 863ea02 commit ab6b8a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "read-excel-file",
"version": "5.6.0",
"version": "5.6.1",
"description": "Read small to medium `*.xlsx` files in a browser or Node.js. Parse to JSON with a strict schema.",
"module": "index.js",
"main": "index.cjs",
Expand Down
5 changes: 4 additions & 1 deletion source/read/isDateTimestamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ export default function isDateTimestamp(value, styleId, styles, options) {
if (!style) {
throw new Error(`Cell style not found: ${styleId}`)
}
if (!style.numberFormat) {
return false
}
if (
// Whether it's a "number format" that's conventionally used for storing date timestamps.
BUILT_IN_DATE_NUMBER_FORMAT_IDS.indexOf(parseInt(style.numberFormat.id)) >= 0 ||
BUILT_IN_DATE_NUMBER_FORMAT_IDS.indexOf(Number(style.numberFormat.id)) >= 0 ||
// Whether it's a "number format" that uses a "formatting template"
// that the developer is certain is a date formatting template.
(options.dateFormat && style.numberFormat.template === options.dateFormat) ||
Expand Down

0 comments on commit ab6b8a2

Please sign in to comment.