aboutsummaryrefslogtreecommitdiffstats
path: root/parser.go
diff options
context:
space:
mode:
authorGrant Ammons <gammons@gmail.com>2016-04-24 09:54:11 -0400
committerGrant Ammons <gammons@gmail.com>2016-04-24 09:54:11 -0400
commitbd362c8e56e3453b6c2874f2d1e81ee350539d65 (patch)
treefa681c16f5fab7be00f344f9002b6168bb86b3fb /parser.go
parent44dd550fdd7e71c1f0edfe3f77a8b9fafab967e8 (diff)
Start figuring out how to parse our specific due dates
Diffstat (limited to 'parser.go')
-rw-r--r--parser.go9
1 files 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)