fix: extend range of selectable years for training attendances
This commit is contained in:
@@ -39,10 +39,14 @@ class CreateController extends AbstractController
|
||||
->setTraining($training)
|
||||
;
|
||||
|
||||
$yearFrom = (int) date('Y');
|
||||
$yearsRange = range($yearFrom + 1, $yearFrom - 10);
|
||||
|
||||
$form = $this
|
||||
->createFormBuilder($attendance)
|
||||
->add('date', AbbreviatedDateType::class, [
|
||||
'label' => 'Datum',
|
||||
'years' => $yearsRange,
|
||||
])
|
||||
->getForm()
|
||||
;
|
||||
|
||||
@@ -25,7 +25,7 @@ class TrainingAttendance implements TimestampableEntityInterface
|
||||
private ?Training $training = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
||||
private ?\DateTimeImmutable $date = null;
|
||||
private ?\DateTimeImmutable $date;
|
||||
|
||||
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
|
||||
private ?Upload $certificate = null;
|
||||
@@ -36,6 +36,7 @@ class TrainingAttendance implements TimestampableEntityInterface
|
||||
public function __construct()
|
||||
{
|
||||
$this->uuid = Uuid::v4();
|
||||
$this->date = new \DateTimeImmutable();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
|
||||
Reference in New Issue
Block a user