From 1689e5eb9cf805b049d6a5ec4f27e43cccd7451d Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sat, 11 Jan 2025 00:31:39 -0500 Subject: [PATCH] fix wrong label when all months selected --- src/views/Chores/ChoreCard.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/Chores/ChoreCard.jsx b/src/views/Chores/ChoreCard.jsx index a41ba69..a9df0a1 100644 --- a/src/views/Chores/ChoreCard.jsx +++ b/src/views/Chores/ChoreCard.jsx @@ -377,9 +377,13 @@ const ChoreCard = ({ const notSelectedShortMonths = notSelectedMonth.map(m => moment().month(m).format('MMM'), ) - return `${chore.frequency}${dayOfMonthSuffix( + let result = `Monthly ${chore.frequency}${dayOfMonthSuffix( chore.frequency, - )} except ${notSelectedShortMonths.join(', ')}` + )}` + if (notSelectedShortMonths.length > 0) + result += ` + except ${notSelectedShortMonths.join(', ')}` + return result } else { let freqData = JSON.parse(chore.frequencyMetadata) const months = freqData.months.map(m => moment().month(m).format('MMM'))