Browse Source

Update AbstractExcelWriteExecutor.java

修改:完善写文件LocalDate的默认格式化模式
pull/2932/head
ywzou 2 years ago committed by GitHub
parent
commit
047d217574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      easyexcel-core/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java

8
easyexcel-core/src/main/java/com/alibaba/excel/write/executor/AbstractExcelWriteExecutor.java

@ -300,7 +300,13 @@ public abstract class AbstractExcelWriteExecutor implements ExcelWriteExecutor {
if (excelContentProperty != null && excelContentProperty.getDateTimeFormatProperty() != null) {
dateFormat = excelContentProperty.getDateTimeFormatProperty().getFormat();
}
WorkBookUtil.fillDataFormat(cellDataValue, dateFormat, DateUtils.defaultDateFormat);
// WorkBookUtil.fillDataFormat(cellDataValue, dateFormat, DateUtils.defaultDateFormat);
String defaultFormat = DateUtils.defaultDateFormat;
Object dateValue = cellDataValue.getDateValue();
if (dateValue instanceof LocalDate) {
defaultFormat = DateUtils.DATE_FORMAT_10;
}
WorkBookUtil.fillDataFormat(cellDataValue, dateFormat, defaultFormat);
return;
case NUMBER:
String numberFormat = null;

Loading…
Cancel
Save