weekly streak calculation logic error
1 parent 8fa042d commit e56a1f0e932f48135b241e452597adcc3c6b1562
0xRoM authored on 14 Jan 2024
Showing 1 changed file
View
2
■■■
habit.php
 
ksort($weeklyOccurrences);
 
foreach ($weeklyOccurrences as $week => $value) {
if ($value >= 2) {
if ($value >= $multiplier) {
$consecutiveCount++;
$maxConsecutiveCount = max($maxConsecutiveCount, $consecutiveCount);
} else {
$consecutiveCount = 0; // Reset count if the value is less than 2
Buy Me A Coffee