Ross Marks
Home
About
Portfolio
Git
Blog
Contact
Youtube
Twitch
Twitter
Linkedin
GitBucket
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Fork
: 0
0xRoM
/
moodlog_web
Browse code
minor logic error
master
1 parent
150ae89
commit
092e85a3ae6293f8f0ee60757f3708d36fbaf96c
0xRoM
authored
on 4 Jan 2024
Patch
Unified
Split
Showing
1 changed file
+2
-1
■
■
■
■■
habit.php
Ignore Space
Show notes
View
3
■
■
■
■■
habit.php
$streak
=
0
;
$thisWeek
=
date
(
'Y-W'
);
// Get the current week
while
(
isset
(
$weeklyOccurrences
[
$thisWeek
])
&&
$weeklyOccurrences
[
$thisWeek
]
==
$multiplier
)
{
while
(
isset
(
$weeklyOccurrences
[
$thisWeek
])
&&
$weeklyOccurrences
[
$thisWeek
]
>=
$multiplier
)
{
$streak
++;
$thisWeek
=
date
(
'Y-W'
,
strtotime
(
$thisWeek
.
' -1 week'
));
}
}
?>
Show line notes below