From ef1512dad650f6f2afc5499df1215f9e855a1786 Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Thu, 12 May 2016 08:35:01 -0400 Subject: Ensure agenda works with other input --- todolist/date_filter.go | 7 +++---- 1 file 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": -- cgit v1.3