Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jesnagifto opened this issue May 11, 2024 · 2 comments
Open

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

jesnagifto opened this issue May 11, 2024 · 2 comments

Comments

@jesnagifto
Copy link

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

@optiktr
Copy link

optiktr commented May 16, 2024

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

@jesnagifto
Copy link
Author

i added this, but can not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants