diff --git a/projects/flixel-desktop-habit-puzzle-game/source/Entry.kiss b/projects/flixel-desktop-habit-puzzle-game/source/Entry.kiss index e62fc150..19e269ef 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/Entry.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/Entry.kiss @@ -7,13 +7,13 @@ (+ (.join (for day days (case day - (0 "Su") (1 "M") (2 "T") (3 "W") (4 "Th") (5 "F") (6 "S") + (7 "Su") (otherwise (throw "bad day")))) "") " " lastDayDone diff --git a/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss b/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss index d45cda66..74bd17a3 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss @@ -58,7 +58,7 @@ ([noColon] (Daily // all days of week - (collect (range 7)) + (collect (range 1 8)) // never done before "")) ([::&mut preColon ...afterColon] @@ -69,7 +69,7 @@ [ // disambiguate Th from T and Su from S: (when (contains preColon "Th") {(set preColon (StringTools.replace preColon "Th" "")) 4}) - (when (contains preColon "Su") {(set preColon (StringTools.replace preColon "Su" "")) 0}) + (when (contains preColon "Su") {(set preColon (StringTools.replace preColon "Su" "")) 7}) (when (contains preColon "M") 1) (when (contains preColon "T") 2) (when (contains preColon "W") 3) @@ -171,7 +171,9 @@ (return false)) (case e.type ((Daily days lastDayDone) - (and !(= lastDayDone (todayString)) (contains days (.getDay (Date.now))))) + (let [&mut today (.getDay (Date.now))] + (when (= today 0) (set today 7)) + (and !(= lastDayDone (todayString)) (contains days today)))) ((Monthly days lastDayDone) // TODO logic (let [&mut nextDay