Chron
2 months ago
276
3
Laravel

time with date and after_or_equal validation returns an error

Posted 2 months ago by Chron

I have this:

'date' =>      'required|date|after_or_equal:today',
'time' =>      'required|date_format:H:i|after_or_equal:today',

It's currently 13:42, 2020-07-06.

For example, I entered 2020-07-07, which is tomorrow, in date field, and 07:30 in time field, it returns an error that says the time must be a date after or equal to today., which is expected.

But is there a way to include the date when validating time?

So the time field would check the time with the date? So it will go to validation like this: 2020-07-07 07:30

Please sign in or create an account to participate in this conversation.