mirror of
https://github.com/Xevion/banner.git
synced 2025-12-07 20:06:25 -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 {
|
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 := ""
|
str := ""
|
||||||
|
|
||||||
if days[time.Monday] {
|
if days[time.Monday] {
|
||||||
|
|||||||
Reference in New Issue
Block a user