Personally I use flatpickr (just switched). I just use Y-m-d from laravel, but tell flatpickr to show it as d-m-Y. Maybe your date picker supports the same function
Edit : https://element-plus.org/en-US/component/date-picker.html#date-formats
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I'm once again in trouble with date casting.
If I cast the start and end dates, if displays the dates in the right format
protected $casts = [
// 'start_date' => 'date:d/m/Y',
// 'end_date' => 'date:d/m/Y',
'archived' => 'boolean',
];
I'm lost among the different protected properties ($dateFormat, $cast, $dates, ...).
Until today, to get the date in the french format (d/m/Y), I used an appended attribute and it worked fine.
I have seen that the casting does the job to display the dates in my local format.
<el-date-picker
v-model="form.start_date"
type="date"
:editable="false"
:clearable="false"
format="DD/MM/YYYY"
value-format="YYYY-MM-DD"
placeholder="Choisir une date de début">
</el-date-picker>
The problem is that the casting acts for each time I need to retrieve a date value. It displays the date in the right format, but when I need to edit a date, the date is sent to the form, it is sent in the french format but I need only in this case to have it in english format.
Is it possible to solve this in an easy way ?
Thanks for your help.
Vincent
You can also just do
return Carbon::parse($this->start_date)->isoFormat('DD/MM/YYYY');
Please or to participate in this conversation.