diff options
| author | Grant Ammons <gammons@gmail.com> | 2017-08-05 07:49:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-05 07:49:37 -0400 |
| commit | e4fc41d2ca95e5fad0eeb9bc40996e2687f78d06 (patch) | |
| tree | 4a290e9787bb8379a37183b63f4a53a8cdb8c563 /todolist/todo_item.go | |
| parent | c22022d228b19f89aa84f8a7514b10c789ebea95 (diff) | |
| parent | d59a0986f51e8a09c6c15446f7141acf86d27d41 (diff) | |
Merge pull request #83 from stuartskelton/Move_code_to_the_right_place0.7
Move code to the right place
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") |
