Mar 9, 2016
0
Level 1
After date validation
Hi to all, I need to validate a date attribute with after clause. I've: $date1 from request with this format: 2016-03-30T00:00:00 $date2 from db with this format: 29-03-2016 (d-m-Y)
This my rules: $rules = array( 'date1' => 'required|date|after:' . $date2formatted );
where date2formatted is strtotime(\DateTime::createFromFormat('d-m-Y', $date2)->format('m/d/Y')) But every time validation fail the after condition. Any suggestions? Thanks a lot
Please or to participate in this conversation.