From 669871be871d16b27367fc0d800d166996e936f0 Mon Sep 17 00:00:00 2001 From: xuu Date: Sat, 15 Mar 2025 22:16:41 -0600 Subject: [PATCH] chore: saving progress --- entry.go | 7 ++++++- main.go | 9 +++++++-- todo.txt | 22 ++++++++++++++++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/entry.go b/entry.go index d16e684..aeeea87 100644 --- a/entry.go +++ b/entry.go @@ -282,7 +282,12 @@ func (a Attributes) GetN(key string, n int) (string, bool) { } return "", false } - +func (a *Attributes) Add(key string, val ...string) { + (*a)[key] = append((*a)[key], val...) +} +func (a *Attributes) Set(key string, val ...string) { + (*a)[key] = val +} type Task struct { Done bool Priority Priority diff --git a/main.go b/main.go index 8cef097..5010403 100644 --- a/main.go +++ b/main.go @@ -33,11 +33,16 @@ func main() { pq.Insert(&entry{p, e}) } } + var nlis []Entry for !pq.IsEmpty() { entry := pq.ExtractMin() e, p := entry.e, entry.time - - fmt.Println(p.Format("2006-01-02"), e.DetailString()) + e.Title += p.Format(" rel:2006-01-02") + e.Attributes.Set("rel", p.Format("2006-01-02")) + nlis = append(nlis, e) } + lis = NewEntries(nlis...) + + fmt.Println(lis) } diff --git a/todo.txt b/todo.txt index 352e15e..8623ab0 100644 --- a/todo.txt +++ b/todo.txt @@ -1 +1,23 @@ +2020 Jan1 New Year's Day @yearly +2020 jan 3Mon Dr. Martin Luther King, Jr Day @yearly +2020 feb 3Mon President's Day @yearly +2020 may -1Mon Memorial Day @yearly +2020 jun19 Juneteenth @yearly +2020 jul1 Independence Day @yearly +2020 jul24 Pioneer Day @yearly +2020 sept 1Mon Labor Day @yearly +2020 oct 2Mon Columbus Day @yearly +2020 nov11 Veteran's Day @yearly +2020 nov 4Thur Thanksgiving Day @yearly +2020 dec25 Christmas Day @yearly + 2025-01 Fri [ ] Take out Trash @weekly +2024-10-17 Thu [x] (A) Did this and that completed:2024-10-18 +2025-10-18 + [ ] (A) Submit important papers + [ ] (B) Work on +ProjectB + - some note +2024-10-21 + - some notes about things to remember for Monday + [ ] Do that +[ ] Travel the stars