summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-12 11:13:36 +0300
committerPaul Buetow <paul@buetow.org>2026-04-12 11:13:36 +0300
commit995e668eaad09334e66fc78ef1df3361103a6086 (patch)
tree63e645919d97c0c408731ef480d4f54048edcdf1
parent19083b1db3570093f1ad05deb87c50693676d7ed (diff)
y1: age current streak against today to drop after missed day
-rw-r--r--src/c/fastforge.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/c/fastforge.c b/src/c/fastforge.c
index c5efbb0..a302bca 100644
--- a/src/c/fastforge.c
+++ b/src/c/fastforge.c
@@ -273,7 +273,15 @@ static void recompute_streak_data_from_history(void) {
if (longest == 0) {
longest = 1;
}
- streak_data.current_streak = run_length;
+
+ time_t today_day_start = local_day_start(time(NULL));
+ time_t last_completion_day = completion_days[completion_day_count - 1];
+ if (last_completion_day == today_day_start ||
+ is_next_local_day(last_completion_day, today_day_start)) {
+ streak_data.current_streak = run_length;
+ } else {
+ streak_data.current_streak = 0;
+ }
streak_data.longest_streak = longest;
}