From c34fdae510debc8d106a68f60799b64b98c9b2f5 Mon Sep 17 00:00:00 2001 From: Grant Ammons Date: Sun, 24 Apr 2016 09:54:29 -0400 Subject: Modify Todo structure to use correct types --- parser_test.go | 4 ++-- todo.go | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/parser_test.go b/parser_test.go index 980aad2..1ab2826 100644 --- a/parser_test.go +++ b/parser_test.go @@ -55,7 +55,7 @@ func TestParseContexts(t *testing.T) { func TestDueToday(t *testing.T) { parser := &Parser{} todo := parser.Parse("do this thing with @bob and @mary due today") - if todo.Due != now.BeginningOfDay() { + if todo.FormattedDue != now.BeginningOfDay() { fmt.Println("Date is different", todo.Due, time.Now()) } } @@ -63,7 +63,7 @@ func TestDueToday(t *testing.T) { func TestDueTomorrow(t *testing.T) { parser := &Parser{} todo := parser.Parse("do this thing with @bob and @mary due tomorrow") - if todo.Due != now.BeginningOfDay().AddDate(0, 0, 1) { + if todo.FormattedDue != now.BeginningOfDay().AddDate(0, 0, 1) { fmt.Println("Date is different", todo.Due, time.Now()) } } diff --git a/todo.go b/todo.go index f918b1e..1319132 100644 --- a/todo.go +++ b/todo.go @@ -3,13 +3,14 @@ package todolist import "time" type Todo struct { - Id string - Subject string - Projects []string - Contexts []string - Due time.Time - Completed bool - Archived bool + Id int + Subject string + Projects []string + Contexts []string + Due string + FormattedDue time.Time + Completed bool + Archived bool } func NewTodo() *Todo { -- cgit v1.3