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