chore: saving progress

This commit is contained in:
xuu 2025-03-15 22:16:41 -06:00
parent 3b75b960e0
commit 669871be87
Signed by: xuu
GPG Key ID: 8B3B0604F164E04F
3 changed files with 35 additions and 3 deletions

View File

@ -282,7 +282,12 @@ func (a Attributes) GetN(key string, n int) (string, bool) {
} }
return "", false 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 { type Task struct {
Done bool Done bool
Priority Priority Priority Priority

View File

@ -33,11 +33,16 @@ func main() {
pq.Insert(&entry{p, e}) pq.Insert(&entry{p, e})
} }
} }
var nlis []Entry
for !pq.IsEmpty() { for !pq.IsEmpty() {
entry := pq.ExtractMin() entry := pq.ExtractMin()
e, p := entry.e, entry.time e, p := entry.e, entry.time
e.Title += p.Format(" rel:2006-01-02")
fmt.Println(p.Format("2006-01-02"), e.DetailString()) e.Attributes.Set("rel", p.Format("2006-01-02"))
nlis = append(nlis, e)
} }
lis = NewEntries(nlis...)
fmt.Println(lis)
} }

View File

@ -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 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