danielales2541 commented on code in PR #4487:
URL: https://github.com/apache/fineract/pull/4487#discussion_r2035482570
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java:
##########
@@ -79,7 +81,7 @@ protected void writeDate(int colIndex, Row row, String value,
CellStyle dateCell
}
LocalDate date1 = LocalDate.parse(value, formatinDB);
DateTimeFormatter expectedFormat = new
DateTimeFormatterBuilder().appendPattern(dateFormat).toFormatter();
-
row.createCell(colIndex).setCellValue(expectedFormat.format(date1));
+
row.createCell(colIndex).setCellValue(Date.from(date1.atStartOfDay(ZoneId.systemDefault()).toInstant()));
Review Comment:
> Can you please elaborate on this? To be honest, i have no idea what you
mean.... Maybe an example would help me...
We switched to the second version because the first one writes the date as
text, which makes Excel not recognize it as a real date and causes validation
to fail. The second option stores the date as a Date object, allowing Excel to
properly apply date validations and related functions.
--
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]