Reputation: 73
While I retrieve data from database, I have a column named 'deadline' it do not displaying in my blade date input field. date input format is 'mm/dd/yyyy'. I tried to format as it is but it do not work.
Here is my code for blade file <input type="date" class="form-control @error('deadline') is-invalid @enderror" name="deadline" value="{{ date('m/d/Y', strtotime($job->deadline)) }}">
I have inspected this field and it shows value correctly but do not appear on by for input
Upvotes: 1
Views: 3975
Reputation: 77
value="{{\Illuminate\Support\Carbon::parse($quote->date_quote)->format("Y-m-d")}}" type="date you should make sure that the value you write is that format (2023-12-30)
Upvotes: 0
Reputation: 2070
From this reference:
One thing to note is that the displayed date format differs from the actual value — the displayed date format will be chosen based on the set locale of the user's browser, whereas the date value is always formatted yyyy-mm-dd
You should set value property in yyyy-mm-dd
format. The output formatting will be based on the user's browser locale. ie, you may not be able to customize <input type="date">
output format.
<input type="date" name="bday" value="2019-09-23">
Upvotes: 5