diff options
| author | Grant Ammons <gammons@gmail.com> | 2016-04-24 09:54:11 -0400 |
|---|---|---|
| committer | Grant Ammons <gammons@gmail.com> | 2016-04-24 09:54:11 -0400 |
| commit | bd362c8e56e3453b6c2874f2d1e81ee350539d65 (patch) | |
| tree | fa681c16f5fab7be00f344f9002b6168bb86b3fb | |
| parent | 44dd550fdd7e71c1f0edfe3f77a8b9fafab967e8 (diff) | |
Start figuring out how to parse our specific due dates
| -rw-r--r-- | parser.go | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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) |
