laravel-admin icon indicating copy to clipboard operation
laravel-admin copied to clipboard

The saved date and the edit page date do not match.

Open jesnagifto opened this issue 9 months ago • 2 comments

  • 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.

Screenshot 2024-05-11 123449 Screenshot 2024-05-11 123511

Steps To Reproduce:

jesnagifto avatar May 11 '24 07:05 jesnagifto

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');

optiktr avatar May 16 '24 11:05 optiktr

i added this, but can not work

jesnagifto avatar May 17 '24 10:05 jesnagifto