Indicate user to set startDate equal to or greater than today + set empty_data in form content field

This commit is contained in:
Julie Lenaerts 2025-01-08 16:18:13 +01:00
parent edcc01149b
commit 57b8dacba0
2 changed files with 2 additions and 0 deletions

View File

@ -46,6 +46,7 @@ class NewsItem implements TrackCreationInterface, TrackUpdateInterface
private string $content = '';
#[Assert\NotNull]
#[Assert\GreaterThanOrEqual('today')]
#[Groups(['read'])]
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATE_IMMUTABLE, nullable: false)]
private ?\DateTimeImmutable $startDate = null;

View File

@ -29,6 +29,7 @@ class NewsItemType extends AbstractType
])
->add('content', ChillTextareaType::class, [
'required' => false,
'empty_data' => '',
])
->add(
'startDate',