Release 2.0.28 (#4172)

See https://github.com/kimai/kimai/pull/4172
This commit is contained in:
Kevin Papst
2023-07-09 15:27:27 +02:00
committed by GitHub
parent 651f812da8
commit 385753fbc3
27 changed files with 182 additions and 53 deletions

View File

@@ -60,9 +60,12 @@ final class ProfileController extends AbstractController
{
$dateFactory = $this->getDateTimeFactory();
$userStats = $repository->getUserStatistics($profile);
$firstEntry = $statisticService->findFirstRecordDate($profile);
$workStartingDay = $profile->getWorkStartingDay();
if ($workStartingDay === null) {
$workStartingDay = $statisticService->findFirstRecordDate($profile);
}
$begin = $firstEntry ?? $dateFactory->getStartOfMonth();
$begin = $workStartingDay ?? $dateFactory->getStartOfMonth();
$end = $dateFactory->getEndOfMonth();
// statistic service does not fill up the complete year by default!
@@ -73,7 +76,7 @@ final class ProfileController extends AbstractController
'tab' => 'charts',
'user' => $profile,
'stats' => $userStats,
'firstTimesheet' => $firstEntry,
'workingSince' => $workStartingDay,
'workMonths' => $statisticService->getMonthlyStats($begin, $end, [$profile])[0]
];