James Cole
2024-08-16 09:39:29 +02:00
parent debfd9160c
commit 8ef17f6686
4 changed files with 76 additions and 65 deletions

View File

@@ -41,9 +41,8 @@ trait DateCalculation
{
$difference = (int)($start->diffInDays($end, true) + 1);
$today = today(config('app.timezone'))->startOfDay();
if ($start->lte($today) && $end->gte($today)) {
$difference = $today->diffInDays($end);
$difference = $today->diffInDays($end) + 1;
}
return (int)(0 === $difference ? 1 : $difference);

View File

@@ -130,6 +130,8 @@ trait GetConfigurationData
/** @var Carbon $todayEnd */
$todayEnd = app('navigation')->endOfPeriod($todayStart, $viewRange);
if ($todayStart->ne($start) || $todayEnd->ne($end)) {
$ranges[ucfirst((string)trans('firefly.today'))] = [$todayStart, $todayEnd];
}