mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
This commit is contained in:
@@ -465,13 +465,13 @@ class Navigation
|
|||||||
$format = $this->preferredCarbonFormat($start, $end);
|
$format = $this->preferredCarbonFormat($start, $end);
|
||||||
$displayFormat = (string)trans('config.month_and_day_js', [], $locale);
|
$displayFormat = (string)trans('config.month_and_day_js', [], $locale);
|
||||||
// increment by month (for year)
|
// increment by month (for year)
|
||||||
if ($start->diffInMonths($end, true) > 1) {
|
if ($start->diffInMonths($end, true) > 1.0) {
|
||||||
$increment = 'addMonth';
|
$increment = 'addMonth';
|
||||||
$displayFormat = (string)trans('config.month_js');
|
$displayFormat = (string)trans('config.month_js');
|
||||||
}
|
}
|
||||||
|
|
||||||
// increment by year (for multi-year)
|
// increment by year (for multi-year)
|
||||||
if ($start->diffInMonths($end, true) > 12) {
|
if ($start->diffInMonths($end, true) > 12.0) {
|
||||||
$increment = 'addYear';
|
$increment = 'addYear';
|
||||||
$displayFormat = (string)trans('config.year_js');
|
$displayFormat = (string)trans('config.year_js');
|
||||||
}
|
}
|
||||||
@@ -494,11 +494,11 @@ class Navigation
|
|||||||
public function preferredCarbonFormat(Carbon $start, Carbon $end): string
|
public function preferredCarbonFormat(Carbon $start, Carbon $end): string
|
||||||
{
|
{
|
||||||
$format = 'Y-m-d';
|
$format = 'Y-m-d';
|
||||||
if ((int)$start->diffInMonths($end, true) > 1) {
|
if ($start->diffInMonths($end, true) > 1.0) {
|
||||||
$format = 'Y-m';
|
$format = 'Y-m';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int)$start->diffInMonths($end, true) > 12) {
|
if ($start->diffInMonths($end, true) > 12.0) {
|
||||||
$format = 'Y';
|
$format = 'Y';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user