From f2b5e56523ef60eea159aa3fe0331f2c64d10596 Mon Sep 17 00:00:00 2001 From: Barney Boisvert Date: Sun, 18 Aug 2024 21:07:16 -0700 Subject: [PATCH] don't include leading ! on plan calendar items --- .../cookbook/services/PlanCalendar.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/brennaswitzer/cookbook/services/PlanCalendar.java b/src/main/java/com/brennaswitzer/cookbook/services/PlanCalendar.java index c7a20aa5..d84360ca 100644 --- a/src/main/java/com/brennaswitzer/cookbook/services/PlanCalendar.java +++ b/src/main/java/com/brennaswitzer/cookbook/services/PlanCalendar.java @@ -90,21 +90,23 @@ private Description getEventDescription(PlanItem item) { appProperties.getPublicUrl(), plan.getId(), item.getId(), - item.getName(), + getDisplayName(item), plan.getName())); } + private String getDisplayName(PlanItem item) { + return item.isRecognitionDisallowed() + ? item.getName().substring(1) + : item.getName(); + } + private Summary getEventSummary(PlanItem item) { StringBuilder sb = new StringBuilder(); switch (item.getStatus()) { case COMPLETED -> sb.append("✔ "); case DELETED -> sb.append("✘ "); } - if (item.isRecognitionDisallowed()) { - sb.append(item.getName().substring(1)); - } else { - sb.append(item.getName()); - } + sb.append(getDisplayName(item)); PlanBucket bucket = item.getBucket(); if (bucket.isNamed()) { sb.append(" - ")