aboutsummaryrefslogtreecommitdiffstats
path: root/todolist/todo_item.go
diff options
context:
space:
mode:
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")
+}