aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/todo_item.go
diff options
context:
space:
mode:
authorStuart Skelton <stuarts@broadbean.com>2017-08-01 13:51:31 +0100
committerStuart Skelton <stuarts@broadbean.com>2017-08-01 14:06:05 +0100
commit650d53a6000a483e11da91b3466e1f57a96c3da0 (patch)
tree13844aba7b8a1fff87a42c9380be3bee867bf22f /todolist/todo_item.go
parentbd8acfdea25486e71e4f19ff0703ef59d5ba5dfa (diff)
Added a filter for completed date
Diffstat (limited to 'todolist/todo_item.go')
-rw-r--r--todolist/todo_item.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/todolist/todo_item.go b/todolist/todo_item.go
index 859e946..eecb409 100644
--- a/todolist/todo_item.go
+++ b/todolist/todo_item.go
@@ -43,4 +43,9 @@ func (t *Todo) Complete() {
func (t *Todo) Uncomplete() {
t.Completed = false
t.CompletedDate = ""
-} \ No newline at end of file
+}
+
+func (t Todo) CompletedDateToDate() string {
+ parsedTime, _ := time.Parse(ISO8601_TIMESTAMP_FORMAT, t.CompletedDate)
+ return parsedTime.Format("2006-01-02")
+}