laravel-admin
laravel-admin copied to clipboard
Date format, not format actully
- Laravel Version: 8.74.0
- PHP Version: PHP/8.0.12
- Laravel-admin: 1.8.14
Description:
try use date('format')
$grid->column('created_at')->date('Y-m-d');
result
2021-12-01T20:21:43.000000Z
Steps To Reproduce:
I've met a similar issue in my environment. Same laravel, PHP and laravel-admin version. What I observe is that when the date is clicked, a datetime picker pops up instead.
use DateTimeInterface;
protected function serializeDate(DateTimeInterface $date)
{
return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
}
Add this method in your model class.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Could you please update the documentation accordingly? According to https://laravel-admin.org/docs/en/model-grid-column-display#Date%20format, calling date($format) directly on the column() should set the display format to the given parameter...