mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Remove static references
This commit is contained in:
@@ -140,30 +140,30 @@ trait CalculateRangeOccurrences
|
||||
{
|
||||
$return = [];
|
||||
$attempts = 0;
|
||||
Log::debug('Rep is weekly.');
|
||||
app('log')->debug('Rep is weekly.');
|
||||
// monday = 1
|
||||
// sunday = 7
|
||||
$dayOfWeek = (int)$moment;
|
||||
Log::debug(sprintf('DoW in repetition is %d, in mutator is %d', $dayOfWeek, $start->dayOfWeekIso));
|
||||
app('log')->debug(sprintf('DoW in repetition is %d, in mutator is %d', $dayOfWeek, $start->dayOfWeekIso));
|
||||
if ($start->dayOfWeekIso > $dayOfWeek) {
|
||||
// day has already passed this week, add one week:
|
||||
$start->addWeek();
|
||||
Log::debug(sprintf('Jump to next week, so mutator is now: %s', $start->format('Y-m-d')));
|
||||
app('log')->debug(sprintf('Jump to next week, so mutator is now: %s', $start->format('Y-m-d')));
|
||||
}
|
||||
// today is wednesday (3), expected is friday (5): add two days.
|
||||
// today is friday (5), expected is monday (1), subtract four days.
|
||||
Log::debug(sprintf('Mutator is now: %s', $start->format('Y-m-d')));
|
||||
app('log')->debug(sprintf('Mutator is now: %s', $start->format('Y-m-d')));
|
||||
$dayDifference = $dayOfWeek - $start->dayOfWeekIso;
|
||||
$start->addDays($dayDifference);
|
||||
Log::debug(sprintf('Mutator is now: %s', $start->format('Y-m-d')));
|
||||
app('log')->debug(sprintf('Mutator is now: %s', $start->format('Y-m-d')));
|
||||
while ($start <= $end) {
|
||||
if (0 === $attempts % $skipMod && $start->lte($start) && $end->gte($start)) {
|
||||
Log::debug('Date is in range of start+end, add to set.');
|
||||
app('log')->debug('Date is in range of start+end, add to set.');
|
||||
$return[] = clone $start;
|
||||
}
|
||||
$attempts++;
|
||||
$start->addWeek();
|
||||
Log::debug(sprintf('Mutator is now (end of loop): %s', $start->format('Y-m-d')));
|
||||
app('log')->debug(sprintf('Mutator is now (end of loop): %s', $start->format('Y-m-d')));
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
Reference in New Issue
Block a user