diff options
| author | Grant Ammons <gammons@gmail.com> | 2016-05-04 14:39:37 -0400 |
|---|---|---|
| committer | Grant Ammons <gammons@gmail.com> | 2016-05-04 14:39:37 -0400 |
| commit | e1b69d2e4a3fc6f5ef0eb4d3716df6ae8a9f92a9 (patch) | |
| tree | 0853e40c9ea2d957a4735d18736be3adb6c71656 | |
| parent | d3b6d589c088ad173c6298c8e6a344d7bc0573b2 (diff) | |
Allow editing due dates and setting it to none
| -rw-r--r-- | todo.go | 4 | ||||
| -rw-r--r-- | todolist/parser.go | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -42,7 +42,7 @@ func usage() { blueBold.Println("\nListing todos") fmt.Println(" When listing todos, you can filter and group the output.\n") - fmt.Println(" todo l due (agenda|tod|today|tom|tomorrow|overdue|this week|next week|mon|tue|wed|thu|fri|sat|sun)") + fmt.Println(" todo l due (agenda|tod|today|tom|tomorrow|overdue|this week|next week|mon|tue|wed|thu|fri|sat|sun|none)") fmt.Println(" todo l overdue") cyan.Println(" Filtering by date:\n") @@ -93,6 +93,8 @@ func usage() { blueBold.Println("\nEditing due dates") yellow.Println("\ttodo e 33 due mon") fmt.Println("\tEdits the todo with 33 and sets the due date to this coming Monday\n") + yellow.Println("\ttodo e 33 due none") + fmt.Println("\tEdits the todo with 33 and removes the due date\n") blueBold.Println("\nDeleting") yellow.Println("\ttodo d 33") diff --git a/todolist/parser.go b/todolist/parser.go index a857f16..59a290a 100644 --- a/todolist/parser.go +++ b/todolist/parser.go @@ -55,6 +55,8 @@ func (p *Parser) Due(input string, day time.Time) string { res := r.FindString(input) res = res[4:len(res)] switch { + case res == "none": + return "" case res == "today": return now.BeginningOfDay().Format("2006-01-02") case res == "tomorrow" || res == "tom": |
