I want the message to appear when the user enters no date or the start date is greater than the end date. The code I made was this:
/**
* @Assert\True(message = "Erro! Verifique as horas. Data inical não pode ser maior que a data final.")
*/
public function isHoraFim()
{
if ($this->horainicial > $this->horafim)
{
return false;
}
else
{
return true;
}
if ($this->horainicial || $this->horafim)
{
return false;
}
return $this->horainicio < $this->horafim;
}
But the error message always appears, except when the user enters no date.