mirror of
https://github.com/Xevion/banner.git
synced 2025-12-08 22:06:32 -06:00
Add WeekdaysToString edge cases (none/all days)
This commit is contained in:
11
helpers.go
11
helpers.go
@@ -124,6 +124,17 @@ func Plural(n int) string {
|
||||
}
|
||||
|
||||
func WeekdaysToString(days map[time.Weekday]bool) string {
|
||||
// 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] {
|
||||
|
||||
Reference in New Issue
Block a user