F
Filamentβ€’15mo ago
Silvio Ney

Datepicker date format

I am trying to format the date using format() method from Datepicker form component but did not worked. my code:
DatePicker::make('due_date')
->required()
->displayFormat('d/m/Y')
->format('d/m/Y')
DatePicker::make('due_date')
->required()
->displayFormat('d/m/Y')
->format('d/m/Y')
No description
5 Replies
toeknee
toekneeβ€’15mo ago
try: ->native(false) does it make a difference
Silvio Ney
Silvio NeyOPβ€’15mo ago
thanks, it worked. I had tried before with native(false) but i was not using the displayFormat method with it a bit annoying native don't work with format
toeknee
toekneeβ€’15mo ago
native is the browsers method you see, that's why
Silvio Ney
Silvio NeyOPβ€’15mo ago
yes, thanks! got it, saw in documentation the example
DatePicker::make('date_of_birth')
->native(false)
->displayFormat('d/m/Y')
DatePicker::make('date_of_birth')
->native(false)
->displayFormat('d/m/Y')
but didn't noticed that i need the native(false), perhaps documentation should explicit this
toeknee
toekneeβ€’15mo ago
Please feel free to do a PR πŸ™‚
Want results from more Discord servers?
Add your server