Closed manuelmaurer closed 8 months ago
I'm sorry for my belated response!
Your date should work fine as long as you use the format that matches your date. In your case, that would be Y-m-d\TH:i:s.vp
.
Here for more information: https://github.com/Respect/Validation/issues/1442#issuecomment-1915657084
If I misunderstood your request, feel free to reopen the issue. I'm here to help! 🐼
I'm trying to validate this json input:
{ "ts": "2019-02-08T09:04:05.317Z" }
using this rule:v::key('ts', v::nullable(v::dateTime('c')))
Which fails, because it does not like the fractional second part (which PHP's DateTime does support). The source seems to be this conversion into a fixed format for the date_parse_from_format function call: https://github.com/Respect/Validation/blob/master/library/Helpers/CanValidateDateTime.php#L33
As the fractional part seems to be quite complicated in the standard, I'm not sure if this is an easy thing to fix. I'll try to play around a bit when I get the time.