laravel-admin
laravel-admin copied to clipboard
The saved date and the edit page date do not match.
- Laravel Version: #.#.#
- PHP Version:
- Laravel-admin: #.#.# we saved date it check the edit page that is not match.
Description:
$grid->column('calling_reminder', __('Calling Reminder'))->display(function ($date) { return date('d-m-Y', strtotime($date)); }); this is the code for grid.. this code get the date value is correct. $form->date('calling_reminder', __('Calling Reminder'))->format('DD-MM-YYYY');
model
public function setCallingReminderAttribute($value)
{
// Parse the input date and format it as 'Ymd'
$this->attributes['calling_reminder'] = \Carbon\Carbon::createFromFormat('d-m-Y', $value)->format('Y-m-d');
}
we click the edit page then show the date is not correct.
Steps To Reproduce:
Firstly, you need set to timezone on laravel. You saw diffrent times because you didnt set timezon. 'timezone' => 'Europe/Istanbul', //For Turkey...
config/app.php
'timezone' => 'UTC', olan kısmı
'timezone' => 'Europe/Istanbul',
$form->date('calling_reminder', __('Calling Reminder'))->format('DD-MM-YYYY');
i added this, but can not work