mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Final fix for #170. Now to make a new release!
This commit is contained in:
parent
6f9675b6d6
commit
5a23b95352
@ -232,7 +232,7 @@ class Navigation
|
||||
return $date;
|
||||
}
|
||||
if ($repeatFreq === 'custom') {
|
||||
return $theDate; // the date is already at the start.
|
||||
return $date; // the date is already at the start.
|
||||
}
|
||||
|
||||
|
||||
@ -283,6 +283,18 @@ class Navigation
|
||||
|
||||
return $date;
|
||||
}
|
||||
// a custom range requires the session start
|
||||
// and session end to calculate the difference in days.
|
||||
// this is then subtracted from $theDate (* $subtract).
|
||||
if($repeatFreq === 'custom') {
|
||||
/** @var Carbon $tStart */
|
||||
$tStart = session('start', Carbon::now()->startOfMonth());
|
||||
/** @var Carbon $tEnd */
|
||||
$tEnd = session('end', Carbon::now()->endOfMonth());
|
||||
$diffInDays = $tStart->diffInDays($tEnd);
|
||||
$date->subDays($diffInDays * $subtract);
|
||||
return $date;
|
||||
}
|
||||
|
||||
throw new FireflyException('Cannot do subtractPeriod for $repeat_freq "' . $repeatFreq . '"');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user