From bd362c8e56e3453b6c2874f2d1e81ee350539d65 Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Sun, 24 Apr 2016 09:54:11 -0400 Subject: Start figuring out how to parse our specific due dates --- parser.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/parser.go b/parser.go index a9a2d24..d3b5968 100644 --- a/parser.go +++ b/parser.go @@ -17,7 +17,7 @@ func (p *Parser) Parse(input string) *Todo { todo.Projects = p.Projects(input) todo.Contexts = p.Contexts(input) if p.hasDue(input) { - todo.Due = p.Due(input) + todo.FormattedDue = p.Due(input) } return todo } @@ -64,13 +64,10 @@ func (p *Parser) Due(input string) time.Time { return now.New(n).Monday().AddDate(0, 0, 7) case res == "tuesday" || res == "tue": n := now.BeginningOfDay() - return now.New(n).Tuesday().AddDate(0, 0, 7) + return now.New(n).Monday().AddDate(0, 0, 1) case res == "wednesday" || res == "wed": n := now.BeginningOfDay() - return now.New(n).Wednesday().AddDate(0, 0, 7) - case res == "wednesday" || res == "wed": - n := now.BeginningOfDay() - return now.New(n).Wednesday().AddDate(0, 0, 7) + return now.New(n).Monday().AddDate(0, 0, 2) case res == "next week": n := now.BeginningOfDay() return now.New(n).Monday().AddDate(0, 0, 7) -- cgit v1.3