Search before asking
Fastexcel version
1.2.0
JDK version
OpenJDK 1.80_452
Operating system
No response
Minimal reproduce step
Test case
@Slf4j
public class Issue3745Test {
@Test
void testUse1904windowing() throws Exception {
File testFile = TestFileUtil.createNewFile("issue/easyexcel/test.xlsx");
// write file
FastExcel.write(testFile, DemoData.class).excelType(ExcelTypeEnum.XLSX)
.use1904windowing(Boolean.TRUE) // set use1904windowing to TRUE
.sheet()
.doWrite(demoData(1));
FastExcel.read(testFile, new AnalysisEventListener<DemoData>() {
@Override
public void invoke(DemoData data, AnalysisContext context) {
boolean isUse1904windowing = context.readSheetHolder().globalConfiguration().getUse1904windowing();
log.info("isUse1904windowing: {}", isUse1904windowing);
Assertions.assertTrue(isUse1904windowing);
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
}
})
.excelType(ExcelTypeEnum.XLSX)
.head(DemoData.class)
.sheet()
.doReadSync();
}
private List<DemoData> demoData(int size) {
List<DemoData> dataList = new ArrayList<>();
for (int i = 0; i < size; i++) {
DemoData demoData = new DemoData();
demoData.setString("String" + i);
demoData.setDate(DateUtil.date());
demoData.setDoubleData(RandomUtil.randomDouble());
dataList.add(demoData);
}
return dataList;
}
}
What did you expect to see?
For the xlsx files, according to the logic of XlsxSaxAnalyser#analysisUse1904WindowDate method , the value of use1904windowing should be true when reading the file.
What did you see instead?
The value of use1904windowing always be false.
Anything else?
Related Issue
easyexcel-issue-3745
Are you willing to submit a PR?
Search before asking
Fastexcel version
1.2.0
JDK version
OpenJDK 1.80_452
Operating system
No response
Minimal reproduce step
Test case
What did you expect to see?
For the
xlsxfiles, according to the logic ofXlsxSaxAnalyser#analysisUse1904WindowDatemethod , the value ofuse1904windowingshould be true when reading the file.What did you see instead?
The value of
use1904windowingalways be false.Anything else?
Related Issue
easyexcel-issue-3745
Are you willing to submit a PR?