You probably have ton configure the date picker. What datepicker are you using ?
Jun 24, 2022
3
Level 1
Carbon date appears with invalid value
I have a Nova "Date" field and it's working fine it shows the current date when the page is accessed at first.
However, if the user selects the date picker and change the date it appears always the same date "2022/0/5" that is incorrect its not the date that the user selected. On the db stores correctly like "2022-06-12".
Do you know where can be the issue?
new Panel('Comments', [
...JSON::make('Comments', [
Text::make('Title'),
Date::make('Date')
->format('Y/m/d')
->resolveUsing(function ($value) {
return Carbon::now()->format('Y/m/d');
})
])->data
]),
Model:
class Settings extends Model
{
use HasFactory;
protected $casts = [
'notes' => 'array',
];
}
Please or to participate in this conversation.