josehernandezfintecheandomx commented on code in PR #2446:
URL: https://github.com/apache/fineract/pull/2446#discussion_r929362651
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/dataqueries/service/GenericDataServiceImpl.java:
##########
@@ -160,23 +161,32 @@ public String generateJsonFromGenericResultsetData(final
GenericResultsetData gr
if (currColType == null && colType.equalsIgnoreCase("DATE")) {
currColType = "DATE";
}
+ if (currColType == null &&
colType.equalsIgnoreCase("DATETIME")) {
+ currColType = "DATETIME";
+ }
currVal = row.get(j);
if (currVal != null && currColType != null) {
if (currColType.equals("DECIMAL") ||
currColType.equals("INTEGER")) {
writer.append(currVal);
} else {
if (currColType.equals("DATE")) {
- final LocalDate localDate =
LocalDate.parse(currVal);
+ final LocalDate localDate =
LocalDate.parse(currVal.toString());
writer.append(
"[" + localDate.getYear() + ", " +
localDate.getMonthValue() + ", " + localDate.getDayOfMonth() + "]");
} else if (currColType.equals("DATETIME")) {
- final LocalDateTime localDateTime =
LocalDateTime.parse(formatDateTimeValue(currVal),
- DateUtils.DEFAULT_DATETIME_FORMATER);
- writer.append("[" + localDateTime.getYear() + ", "
+ localDateTime.getMonthValue() + ", "
- + localDateTime.getDayOfMonth() + ", " +
localDateTime.getHour() + ", " + localDateTime.getMinute()
- + ", " + localDateTime.getSecond() + ", "
+ localDateTime.get(ChronoField.MILLI_OF_SECOND) + "]");
+ Calendar dateVal = Calendar.getInstance();
+ if (currVal instanceof Date) {
+ dateVal.setTime((Date) currVal);
+ } else if (currVal instanceof LocalDateTime) {
+ dateVal.setTime(
+ Date.from(((LocalDateTime)
currVal).atZone(DateUtils.getDateTimeZoneOfTenant()).toInstant()));
Review Comment:
Done! It was removed due we're using LocalDateTime now
--
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]