mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-31 19:27:51 -06:00
Catch the latest exceptions for #170.
This commit is contained in:
parent
bb8ce30552
commit
6f9675b6d6
@ -82,6 +82,20 @@ class Navigation
|
||||
|
||||
$subDay = ['week', 'weekly', '1W', 'month', 'monthly', '1M', '3M', 'quarter', 'quarterly', '6M', 'half-year', 'year', 'yearly'];
|
||||
|
||||
// if the range is custom, the end of the period
|
||||
// is another X days (x is the difference between start)
|
||||
// and end added to $theCurrentEnd
|
||||
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);
|
||||
$currentEnd->addDays($diffInDays);
|
||||
|
||||
return $currentEnd;
|
||||
}
|
||||
|
||||
if (!isset($functionMap[$repeatFreq])) {
|
||||
throw new FireflyException('Cannot do endOfPeriod for $repeat_freq "' . $repeatFreq . '"');
|
||||
}
|
||||
@ -152,6 +166,7 @@ class Navigation
|
||||
$formatMap = [
|
||||
'1D' => '%e %B %Y',
|
||||
'daily' => '%e %B %Y',
|
||||
'custom' => '%e %B %Y',
|
||||
'1W' => 'Week %W, %Y',
|
||||
'week' => 'Week %W, %Y',
|
||||
'weekly' => 'Week %W, %Y',
|
||||
|
Loading…
Reference in New Issue
Block a user