diff options
| author | Grant Ammons <gammons@gmail.com> | 2017-04-20 09:12:34 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-20 09:12:34 -0400 |
| commit | 0192445ebc98afc7d31b6784080496fd7085d4b3 (patch) | |
| tree | 91b8b8d5c17103cd16532939fe23a2b2f19a1239 /todolist/parser.go | |
| parent | e118736cf7df17dc10822fab36af7407c7e110a6 (diff) | |
| parent | a0db863a64d1530b15a18725d323e87776a8a52c (diff) | |
Merge pull request #55 from initrd/master
Add support for showing tasks due the previous week.
Diffstat (limited to 'todolist/parser.go')
| -rw-r--r-- | todolist/parser.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/todolist/parser.go b/todolist/parser.go index ca5083a..1f070c3 100644 --- a/todolist/parser.go +++ b/todolist/parser.go @@ -94,6 +94,9 @@ func (p *Parser) Due(input string, day time.Time) string { return p.saturday(day) case "sunday", "sun": return p.sunday(day) + case "last week": + n := bod(time.Now()) + return getNearestMonday(n).AddDate(0, 0, -7).Format("2006-01-02") case "next week": n := bod(time.Now()) return getNearestMonday(n).AddDate(0, 0, 7).Format("2006-01-02") |
