Hi, how can I use datepicker control in form rule as in example below? The date_from control's getValue() return DateTimeImmutable instance which does not have __toString() implemented thus throws an error in Nette\Forms\Validator::formatMessage()
$form->addDatePicker('date_from', 'Dátum od');
$form->addDatePicker('date_to', 'Dátum do')
->addRule($form::RANGE, 'Please select date between %d and %d', [$form['date_from'], new \Nette\Utils\DateTime()]);
Hi, how can I use datepicker control in form rule as in example below? The
date_from
control'sgetValue()
returnDateTimeImmutable
instance which does not have__toString()
implemented thus throws an error inNette\Forms\Validator::formatMessage()
Thanks!