diff options
| -rw-r--r-- | todolist/date_filter.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/todolist/date_filter.go b/todolist/date_filter.go index 404e0b1..a502d62 100644 --- a/todolist/date_filter.go +++ b/todolist/date_filter.go @@ -1,7 +1,6 @@ package todolist import ( - "fmt" "regexp" "time" @@ -17,12 +16,12 @@ func NewDateFilter(todos []*Todo) *DateFilter { } func (f *DateFilter) FilterDate(input string) []*Todo { - if input == "agenda" { - fmt.Println("input IS agenda") + agendaRegex, _ := regexp.Compile(`agenda .*$`) + if agendaRegex.MatchString(input) { return f.filterAgenda(now.BeginningOfDay()) } - r, _ := regexp.Compile(`due .*$`) + r, _ := regexp.Compile(`due .*$`) match := r.FindString(input) switch { case match == "due tod" || match == "due today": |
