diff options
| author | Grant Ammons <gammons@gmail.com> | 2017-08-02 19:04:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-02 19:04:15 -0400 |
| commit | c22022d228b19f89aa84f8a7514b10c789ebea95 (patch) | |
| tree | a018c42068b24359fa645903a48cdb6c6f9d43df /todolist/todo_item.go | |
| parent | ca8ee26484fa425b8228417534aca557bc7f04f6 (diff) | |
| parent | 810399690f556f4c4eac53d041e1a86d91b890e6 (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.go | 7 |
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") +} |
