From ef18e31975eb998bdc4ed922c7b77281721d08d4 Mon Sep 17 00:00:00 2001 From: Nikolaus Gotsche Date: Wed, 13 Mar 2019 12:45:50 +0100 Subject: Comments are shown when charging, already charged Tasks shown --- sqlite.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sqlite.go') diff --git a/sqlite.go b/sqlite.go index 108e751..76a226b 100644 --- a/sqlite.go +++ b/sqlite.go @@ -940,6 +940,16 @@ func GetSelectedProjects(in []int) (out []Project) { return } +// Return the Comments of all selected Tasks if they exist as a []string +func GetSelectedComments(in []Task) (comms []string) { + for _,tsk := range in { + if len(tsk.Comment) > 0{ + comms = append(comms,fmt.Sprintf("%s - %s",tsk.Taskname,tsk.Comment)) + } + } + return +} + // Return the []tasks corresponding to an []int of task ids func GetSelectedTasks(in []int) (outtask []Task) { ins := strings.Trim(strings.Replace(fmt.Sprint(in), " ", " , ", -1), "[]") -- cgit v1.2.3