corrected times for missing values

This commit is contained in:
Jörg Henke
2022-07-01 18:18:36 +02:00
parent 98b3f9d804
commit f48878ee7e

View File

@ -1,6 +1,7 @@
package de.jottyfan.timetrack.spring.done; package de.jottyfan.timetrack.spring.done;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ -22,7 +23,7 @@ public class SummaryBean implements Serializable {
* @return the start * @return the start
*/ */
public String getStart() { public String getStart() {
LocalDateTime found = LocalDateTime.now(); LocalDateTime found = LocalDate.now().atTime(23, 59);
for (DoneBean bean : list) { for (DoneBean bean : list) {
LocalDateTime ldt = bean.getTimeFrom(); LocalDateTime ldt = bean.getTimeFrom();
if (ldt != null && ldt.isBefore(found)) { if (ldt != null && ldt.isBefore(found)) {
@ -36,7 +37,7 @@ public class SummaryBean implements Serializable {
* @return the end * @return the end
*/ */
public String getEnd() { public String getEnd() {
LocalDateTime found = LocalDateTime.now(); LocalDateTime found = LocalDate.now().atTime(0, 0);
for (DoneBean bean : list) { for (DoneBean bean : list) {
LocalDateTime ldt = bean.getTimeUntil(); LocalDateTime ldt = bean.getTimeUntil();
if (ldt != null && found.isBefore(ldt)) { if (ldt != null && found.isBefore(ldt)) {