ongdisheng commented on issue #714:
URL: https://github.com/apache/fesod/issues/714#issuecomment-3588292557
Hi @kt286, Thank you for providing the reproducible demo! I've investigated
the problem and created a potential fix that handles both `java.util.Date` and
`java.sql.Date`:
```java
public WriteCellData(Date dateValue) {
super();
if (dateValue == null) {
throw new IllegalArgumentException("DateValue can not be null");
}
setType(CellDataTypeEnum.DATE);
// Use getTime() which works for both java.util.Date and java.sql.Date
this.dateValue = LocalDateTime.ofInstant(
Instant.ofEpochMilli(dateValue.getTime()),
ZoneId.systemDefault()
);
}
```
This approach works for both types since `getTime()` is available on both
classes. However, I think this might need feedback from the project maintainers
to see if this is the right approach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]