From a0db863a64d1530b15a18725d323e87776a8a52c Mon Sep 17 00:00:00 2001 From: Ashish Vijayaram Date: Mon, 17 Apr 2017 12:36:46 -0700 Subject: Add support for showing tasks due the previous week. This is useful for those who need a report of entries from last week. --- todolist/parser.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'todolist/parser.go') 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") -- cgit v1.3