Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ protected void findAnimalsWithEnoughWater(final Container c, final User u, final
String mlsPerKg;
String totalWater;
for(Map<String,Object> mapItem : totalWaterByProject){
LocalDateTime objectDateTime = ConvertHelper.convert(mapItem.get("date"),Date.class).toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
// Casts date & time manually before formatting.
// Using 'toInstant()' without casting first will throw an error due to ConvertHelper.convert() returning a 'java.sql.Date' instead of the 'java.util.Date' required by toInstant().
Date rawDate = (Date) ConvertHelper.convert(mapItem.get("date"), Date.class);
Date utilDate = new Date(rawDate.getTime());
LocalDateTime objectDateTime = utilDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

mlsPerKg = ConvertHelper.convert(mapItem.get("mlsPerKg"),String.class) == null ? " " : ConvertHelper.convert(mapItem.get("mlsPerKg"),String.class);
Expand Down