adamsaghy commented on code in PR #4510:
URL: https://github.com/apache/fineract/pull/4510#discussion_r2036860158
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java:
##########
@@ -78,8 +80,7 @@ protected void writeDate(int colIndex, Row row, String value,
CellStyle dateCell
throw new IllegalArgumentException("Unrecognised format of
date value: " + value);
}
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:
My problem here is this method is designed to write the date as the incoming
dateFormat parameter tells.
I wonder what the issue is with that... However if you think this is
incorrect, then the whole method and import / export logic should be reviewed,
no?
Btw you dont need need Date object... you already has the value as LocalDate:
LocalDate date1 = LocalDate.parse(value, formatinDB);
You can set that as cellValue directly:
row.createCell(colIndex).setCellValue(date1);
If we are about to change this behaviour from now on, we should remove the
date format and i am kindly asking you to raise this concern and change son the
public, official FINERACT DEV maillist hence this is a "breaking" change!
--
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]