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;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@ -22,7 +23,7 @@ public class SummaryBean implements Serializable {
* @return the start
*/
public String getStart() {
LocalDateTime found = LocalDateTime.now();
LocalDateTime found = LocalDate.now().atTime(23, 59);
for (DoneBean bean : list) {
LocalDateTime ldt = bean.getTimeFrom();
if (ldt != null && ldt.isBefore(found)) {
@ -36,7 +37,7 @@ public class SummaryBean implements Serializable {
* @return the end
*/
public String getEnd() {
LocalDateTime found = LocalDateTime.now();
LocalDateTime found = LocalDate.now().atTime(0, 0);
for (DoneBean bean : list) {
LocalDateTime ldt = bean.getTimeUntil();
if (ldt != null && found.isBefore(ldt)) {