mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 13:16:31 +00:00
Autoformat lol
This commit is contained in:
@@ -24,8 +24,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Http\Controllers;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
|
||||
/**
|
||||
* Trait DateCalculation
|
||||
@@ -41,13 +41,13 @@ trait DateCalculation
|
||||
*/
|
||||
public function activeDaysLeft(Carbon $start, Carbon $end): int
|
||||
{
|
||||
$difference = (int)($start->diffInDays($end, true) + 1);
|
||||
$difference = (int) ($start->diffInDays($end, true) + 1);
|
||||
$today = today(config('app.timezone'))->startOfDay();
|
||||
if ($start->lte($today) && $end->gte($today)) {
|
||||
$difference = $today->diffInDays($end) + 1;
|
||||
}
|
||||
|
||||
return (int)(0 === $difference ? 1 : $difference);
|
||||
return (int) (0 === $difference ? 1 : $difference);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ trait DateCalculation
|
||||
$difference = $start->diffInDays($today, true) + 1;
|
||||
}
|
||||
|
||||
return (int)$difference;
|
||||
return (int) $difference;
|
||||
}
|
||||
|
||||
protected function calculateStep(Carbon $start, Carbon $end): string
|
||||
@@ -91,23 +91,23 @@ trait DateCalculation
|
||||
protected function getNextPeriods(Carbon $date, string $range): array
|
||||
{
|
||||
// select thing for next 12 periods:
|
||||
$loop = [];
|
||||
$loop = [];
|
||||
|
||||
/** @var Carbon $current */
|
||||
$current = Navigation::startOfPeriod($date, $range);
|
||||
$current = Navigation::endOfPeriod($current, $range);
|
||||
$current->addDay();
|
||||
$count = 0;
|
||||
$count = 0;
|
||||
|
||||
while ($count < 12) {
|
||||
$current = Navigation::endOfPeriod($current, $range);
|
||||
$currentStart = Navigation::startOfPeriod($current, $range);
|
||||
|
||||
$loop[] = [
|
||||
$loop[] = [
|
||||
'label' => $current->format('Y-m-d'),
|
||||
'title' => Navigation::periodShow($current, $range),
|
||||
'start' => clone $currentStart,
|
||||
'end' => clone $current,
|
||||
'end' => clone $current
|
||||
];
|
||||
++$count;
|
||||
$current->addDay();
|
||||
@@ -123,7 +123,7 @@ trait DateCalculation
|
||||
protected function getPreviousPeriods(Carbon $date, string $range): array
|
||||
{
|
||||
// select thing for last 12 periods:
|
||||
$loop = [];
|
||||
$loop = [];
|
||||
|
||||
/** @var Carbon $current */
|
||||
$current = Navigation::startOfPeriod($date, $range);
|
||||
@@ -132,11 +132,11 @@ trait DateCalculation
|
||||
$current->subDay();
|
||||
$current = Navigation::startOfPeriod($current, $range);
|
||||
$currentEnd = Navigation::endOfPeriod($current, $range);
|
||||
$loop[] = [
|
||||
$loop[] = [
|
||||
'label' => $current->format('Y-m-d'),
|
||||
'title' => Navigation::periodShow($current, $range),
|
||||
'start' => clone $current,
|
||||
'end' => clone $currentEnd,
|
||||
'end' => clone $currentEnd
|
||||
];
|
||||
++$count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user