diff --git a/src/main/java/de/esterlino/timeplater/worktimes/ouputter/TemplateStringWorkWeekOutputter.java b/src/main/java/de/esterlino/timeplater/worktimes/ouputter/TemplateStringWorkWeekOutputter.java index 63eecc1..d2b42e5 100644 --- a/src/main/java/de/esterlino/timeplater/worktimes/ouputter/TemplateStringWorkWeekOutputter.java +++ b/src/main/java/de/esterlino/timeplater/worktimes/ouputter/TemplateStringWorkWeekOutputter.java @@ -19,11 +19,18 @@ public String createOutput(WorkWeek workWeek) { StringBuilder output = new StringBuilder(); for (WorkDay day : workWeek.getWorkDays()) { - output.append(DateTimeFormatUtils.workDayFormat(day, workWeek.getCalendarWeek())); - output.append("\n"); + appendDay(output, workWeek.getCalendarWeek(), day); } return new String(output); } + private void appendDay(final StringBuilder toAppendTo, final int calendarWeek, final WorkDay workDay) { + if (workDay.getHomeTime() == null || workDay.getHomeTime().getWorkDuration().isZero()) { + return; + } + + toAppendTo.append(DateTimeFormatUtils.workDayFormat(workDay, calendarWeek)); + toAppendTo.append("\n"); + } }