Add WeekdaysToString edge cases (none/all days)

This commit is contained in:
2024-01-14 22:24:03 -06:00
parent b331433d8d
commit 6e5931f8ba

View File

@@ -124,8 +124,19 @@ func Plural(n int) string {
}
func WeekdaysToString(days map[time.Weekday]bool) string {
str := ""
// If no days are present
numDays := len(days)
if numDays == 0 {
return "None"
}
// If all days are present
if numDays == 7 {
return "Everyday"
}
str := ""
if days[time.Monday] {
str += "M"
}