Undesirable behavior on DateRangePicker
Closed this issue · 2 comments
lepresk commented
After selecting a date, the DateRangerPicker component automatically adds the time to the input (see screenshot). This was not the case before version 2.5.2.
If this is how it normally works, how can you display only the date without the time ?
My code
DateRangePicker::make('period')
->default(sprintf(
"%s - %s",
now()->startOfMonth()->subDays(30)->format('d/m/Y'),
now()->startOfMonth()->format('d/m/Y'),
))
->label('Période'),
malzariey commented
Issue fixed with latest version, you can also use the displayformat to change the format
lepresk commented
Setting de displayFormat
help to fix the issue :
DateRangePicker::make('period')
->displayFormat("DD/MM/YYYY")
->default(sprintf(
"%s - %s",
now()->startOfMonth()->subDays(30)->format('d/m/Y'),
now()->startOfMonth()->format('d/m/Y'),
))
->label('Période'),