From 8578bbe033ad8a5573094acceb4c08530be18d81 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Thu, 13 Jun 2024 22:31:33 +0200 Subject: [PATCH] improve project end handling --- src/Form/QuickEntryForm.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Form/QuickEntryForm.php b/src/Form/QuickEntryForm.php index 069a6f98..e2c23689 100644 --- a/src/Form/QuickEntryForm.php +++ b/src/Form/QuickEntryForm.php @@ -25,7 +25,7 @@ use Symfony\Component\Validator\Constraints\Valid; final class QuickEntryForm extends AbstractType { - public function __construct(private SystemConfiguration $configuration) + public function __construct(private readonly SystemConfiguration $configuration) { } @@ -70,7 +70,10 @@ final class QuickEntryForm extends AbstractType 'entry_options' => [ 'label' => false, 'duration_minutes' => $this->configuration->getTimesheetIncrementDuration(), - 'start_date' => $options['start_date'], + // this is NOT the start_date, because it would prevent projects from appearing + // in the first days of the week, if the projects ends at the end of the week + // the validation still triggers if the user selects days outside the project range + 'start_date' => $options['end_date'], 'end_date' => $options['end_date'], 'empty_data' => function (FormInterface $form) use ($options) { return clone $options['prototype_data'];