mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Added magic words "currentMonthEnd" and "currentMonthStart".
This commit is contained in:
parent
59fff8928b
commit
f5cbed7c0c
@ -32,6 +32,14 @@ class Date implements BinderInterface
|
||||
*/
|
||||
public static function routeBinder($value, $route)
|
||||
{
|
||||
if($value === 'currentMonthStart') {
|
||||
return Carbon::now()->startOfMonth();
|
||||
}
|
||||
if($value === 'currentMonthEnd') {
|
||||
return Carbon::now()->endOfMonth();
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
$date = new Carbon($value);
|
||||
} catch (Exception $e) {
|
||||
@ -41,4 +49,4 @@ class Date implements BinderInterface
|
||||
|
||||
return $date;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,8 +95,8 @@
|
||||
<li>
|
||||
<a href="{{ route('reports.report',
|
||||
['default',
|
||||
startOfMonth.format('Ymd'),
|
||||
endOfMonth.format('Ymd'),
|
||||
'currentMonthStart',
|
||||
'currentMonthEnd',
|
||||
accountList
|
||||
]) }}">{{ 'report_this_month_quick'|_ }}</a>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user