mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Added magic words "currentMonthEnd" and "currentMonthStart".
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user