How Streaks and Completion Rates Are Computed
AnyTool Habit Tracker uses the “don’t break the chain” method: each habit keeps a log keyed by the local calendar date (YYYY-MM-DD), and a day is “done” when its logged count meets the habit’s daily target (target one means a simple done/not-done). The current streak walks backwards from today, counting consecutive scheduled days that are done and stopping at the first scheduled miss; if today is scheduled but not yet marked, counting begins from yesterday so an un-checked today never shows the chain as broken before the day ends. Days the habit isn’t scheduled for are skipped — they neither extend nor break the streak — so a Monday/Wednesday/Friday habit is not penalised for the weekend. The longest streak scans the whole log from the earliest done date to the latest, tracking the best run of consecutive scheduled-and-done days. The completion rate is done divided by scheduled days over a rolling window (30 days), never counting dates before the habit was created. All date maths use plain local-time Date objects so there are no timezone surprises.
- Per-habit log keyed by local date; a day is done when its count meets the daily target
- Current streak = consecutive scheduled done days back from today (or yesterday if today is unmarked)
- Un-scheduled days are skipped — they never extend or break a streak
- Longest streak scans the full history for the best run of scheduled-and-done days
- Completion % = done / scheduled over the last 30 days, ignoring pre-creation dates
