Waleed
Waleed

Reputation: 1188

date_format not validating in Laravel

I am using this validation for dates:

'fiscal_end' => 'required|date_format:dd/mm/yyyy'

Doing:

print_r(Input::all());
die();

I get:

[fiscal_end] => 25/01/2017 

I don't understand what's wrong here that generates the error: Date needs to be in proper format dd/mm/yyyy.

I am using Laravel 5.3 and datefield on form is actually Bootstrap Datepicker field.

Upvotes: 1

Views: 10227

Answers (1)

Niklesh Raut
Niklesh Raut

Reputation: 34914

You are doing with wrong format dd/mm/yyyy

Change your format as d/m/Y

Upvotes: 10

Related Questions