fix wrong label when all months selected

This commit is contained in:
Mo Tarbin 2025-01-11 00:31:39 -05:00
parent 46f7f51d3a
commit 1689e5eb9c

View file

@ -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'))