aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/todo_item.go
diff options
context:
space:
mode:
authorGrant Ammons <gammons@gmail.com>2017-08-02 19:04:15 -0400
committerGitHub <noreply@github.com>2017-08-02 19:04:15 -0400
commitc22022d228b19f89aa84f8a7514b10c789ebea95 (patch)
treea018c42068b24359fa645903a48cdb6c6f9d43df /todolist/todo_item.go
parentca8ee26484fa425b8228417534aca557bc7f04f6 (diff)
parent810399690f556f4c4eac53d041e1a86d91b890e6 (diff)
Merge pull request #82 from stuartskelton/Add_list_completed
Add list completed
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")
+}