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

DateTimeZone #1063

Open
ne2d opened this issue Jan 24, 2023 · 1 comment
Open

DateTimeZone #1063

ne2d opened this issue Jan 24, 2023 · 1 comment

Comments

@ne2d
Copy link

ne2d commented Jan 24, 2023

It's possible to set up here timezone? Something like this? $date->setTimezone(new \DateTimeZone('Europe/Prague'));

@mskocik
Copy link

mskocik commented Jun 13, 2023

You can set it in custom renderer through setRenderer, although it renders usage of ColumnDateTime useless and you can use ColumnText instead. Something like this:

$tz = new \DateTimeZone('Europe/Prague');
$grid->setColumnText('date', 'Date') // of course you can call `addColumnDateTime`
  ->setRenderer(function($item) use ($tz) {
    $date = $item->dateProp;
    $date->setTimezone($tz);
    return $date->format('Y-m-d');
  });

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

No branches or pull requests

2 participants