adjaf
1 year ago

Request Validator for ISOString Date with milliseconds

Posted 1 year ago by adjaf

I'm working with data sent from a React Native App, i have an events table and I want to validate the dates, they're sent as ISOString

Request Example:

{
...
"start_date": "2018-09-18T10:00:00.000Z",
...
}

In my Request Validator the field validator looks like this:

{
...
'start_date' => 'required|date_format:Y-m-d\TH:i:s.u\Z',
...
}

I have tried .u, .v, :v but i keep getting invalid data.

How can I validate the full ISOString as a date_format ?

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