fix habit game type errors

This commit is contained in:
2022-06-01 17:15:49 +00:00
parent e3d7365d75
commit 6443f12072
2 changed files with 6 additions and 3 deletions

View File

@@ -107,8 +107,11 @@
points (count (l.split "") ->c (= c "|")))))))
(otherwise (break))))))
(method :Array<Entry> allEntries []
(cast (concat dailyEntries monthlyEntries intervalEntries bonusEntries todoEntries)))
(method :Int totalPoints []
(apply + (for l (flatten (for e (the Array<Entry> (concat dailyEntries monthlyEntries intervalEntries bonusEntries todoEntries)) e.labels)) l.points)))
(apply + (for l (flatten (for e (allEntries) e.labels)) l.points)))
(function :String stringify [:Entry e]
"$(case e.type
@@ -174,7 +177,7 @@
dayToEndSearch
(if lastDayDone
(DateTime.fromString lastDayDone)
(let [now (DateTime.fromDate (Date.now))]
(let [&mut now (DateTime.fromDate (Date.now))]
(until (= 1 (now.getDay)) #|now -= oneDayInterval;|#)
now))]
(until (and (= (nextDay.getDay) (dayToEndSearch.getDay)) (= (nextDay.getMonth) (dayToEndSearch.getMonth)) (= (nextDay.getYear) (dayToEndSearch.getYear)))

View File

@@ -79,7 +79,7 @@
(map (m.activeTodoEntries) makeText)
(add entryTexts)
(doFor e (the Array<Entry> (concat m.dailyEntries m.monthlyEntries m.intervalEntries m.bonusEntries m.todoEntries))
(doFor e (m.allEntries)
(when (HabitModel.isActive e)
(let [label (HabitModel.activeLabel e)]
(shortcutHandler.registerItem label.label e))))