diff options
| author | Stuart Skelton <stuarts@broadbean.com> | 2017-08-04 22:02:37 +0100 |
|---|---|---|
| committer | Stuart Skelton <stuarts@broadbean.com> | 2017-08-04 22:02:37 +0100 |
| commit | 05ad454f50422f0eab4228e819cbadbe9e6a918a (patch) | |
| tree | 7a59c2cc79aa252956444f78dee945e89f461eaf /todolist/todo_item.go | |
| parent | c22022d228b19f89aa84f8a7514b10c789ebea95 (diff) | |
Empower the todo_item to set its attributes correctly itself.
Diffstat (limited to 'todolist/todo_item.go')
| -rw-r--r-- | todolist/todo_item.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/todolist/todo_item.go b/todolist/todo_item.go index eecb409..0c30707 100644 --- a/todolist/todo_item.go +++ b/todolist/todo_item.go @@ -45,6 +45,22 @@ func (t *Todo) Uncomplete() { t.CompletedDate = "" } +func (t *Todo) Archive() { + t.Archived = true +} + +func (t *Todo) Unarchive() { + t.Archived = false +} + +func (t *Todo) Prioritize() { + t.IsPriority = true +} + +func (t *Todo) Unprioritize() { + t.IsPriority = false +} + func (t Todo) CompletedDateToDate() string { parsedTime, _ := time.Parse(ISO8601_TIMESTAMP_FORMAT, t.CompletedDate) return parsedTime.Format("2006-01-02") |
