Z3d0X / filament-logger

Extensible activity logger for filament that works out-of-the-box.
MIT License
287 stars 42 forks source link

fix: use users timezone for display #8

Closed phpsa closed 1 year ago

phpsa commented 2 years ago

Filament recently introduced the abilility for tables and forms to show dates / times in the users timezone, this patch updates the date on the view to do that aswell

Z3d0X commented 2 years ago

Umm why do we need to fake a DateTime Field to achieve this. Wouldn't setTimezone(config('app.timezone')) work as well?

And also what about the timezone on TableColumn?

phpsa commented 2 years ago

Basically you can have the app using UTC and the user have a timezone for viewing in a different timezone - new since 2.12.20

So if time stored i. Utc and i want pacific/aukland for display - this will sort it, as it does on both form inputs and table columns.

That said - there may be a better way of doing it, however, i have not looked at another way yet.

Z3d0X commented 2 years ago

@phpsa I'm going hold off on this for the time being.

If you want have this in your project you can set a custom resource in the config and use it.