Skip to content

Commit b0d22d1

Browse files
authored
Merge pull request #527 from mumberrymountain/fix-issue-521
fix: [#521] date1904 not applies when xml attr has val "1" instead of "true"
2 parents 34bb331 + a9db49b commit b0d22d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fastexcel-reader/src/main/java/org/dhatim/fastexcel/reader/ReadableWorkbook.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ private void readWorkbook(SimpleXmlReader r) throws XMLStreamException {
120120
r.forEach("sheet", "sheets", this::createSheet);
121121
} else if ("workbookPr".equals(r.getLocalName())) {
122122
String date1904Value = r.getAttribute("date1904");
123-
date1904 = Boolean.parseBoolean(date1904Value);
123+
if(date1904Value != null) {
124+
date1904 = "true".equalsIgnoreCase(date1904Value) || "1".equals(date1904Value);
125+
}
124126
} else {
125127
break;
126128
}

0 commit comments

Comments
 (0)