diff options
| author | Grant Ammons <gammons@gmail.com> | 2017-04-12 08:54:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-12 08:54:19 -0400 |
| commit | e118736cf7df17dc10822fab36af7407c7e110a6 (patch) | |
| tree | 651dfc58c6c144bd1349dfe6a74c9aed477cf13f /todolist/util.go | |
| parent | 146f19e1dc8143096bca6bfd0adf2e1f8d9be7b7 (diff) | |
| parent | 8badae37312c70bc9ae68c7c6c0792033fb0dbd1 (diff) | |
Merge pull request #53 from ingorichter/ingo/completion-date
Add `CompletedDate` to todo item
Diffstat (limited to 'todolist/util.go')
| -rw-r--r-- | todolist/util.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/todolist/util.go b/todolist/util.go index 72d475f..34f9dd1 100644 --- a/todolist/util.go +++ b/todolist/util.go @@ -32,9 +32,17 @@ func AddTodoIfNotThere(arr []*Todo, item *Todo) []*Todo { func bod(t time.Time) time.Time { year, month, day := t.Date() + return time.Date(year, month, day, 0, 0, 0, 0, t.Location()) } +func timestamp(t time.Time) time.Time { + year, month, day := t.Date() + hour, min, sec := t.Clock() + + return time.Date(year, month, day, hour, min, sec, 0, t.Location()) +} + func getNearestMonday(t time.Time) time.Time { for { if t.Weekday() != time.Monday { |
