Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
allow mutliple repItems for one goal in each interval
  • Loading branch information
David Tahir committed Jan 10, 2022
commit 29b98f3f7bda2d0907b6a23887a3345ea3a1518f
5 changes: 2 additions & 3 deletions lib/Controller/AjaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1243,19 +1243,18 @@ public function getGoals(){
}
$workedSecondsCurrentPeriod = 0;
$debtSeconds = 0;
array_pop($intervals);
foreach($intervals as $interval){
$workedInInterval = 0;
foreach($repItems as $repItem) {

if ($goal->interval == 'Weekly'){
if ($interval == $this->getStartOfWeek($repItem->time)->format('Y-m-d')) {
$workedInInterval = $repItem->totalDuration;
$workedInInterval += $repItem->totalDuration;
break;
}
} elseif ($goal->interval == 'Monthly'){
if ($interval == $this->getStartOfMonth($repItem->time)->format('Y-m')) {
$workedInInterval = $repItem->totalDuration;
$workedInInterval += $repItem->totalDuration;
break;
}
}
Expand Down