Closed jsmit99 closed 2 years ago
Unable to reproduce the issue, please provide full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)
It's actually quite simple, change the user timezone to something different from UTC in Nova and check value metrics which are saved with a different value (UTC value) in mysql.
No, it is not, and we have multiple feature tests already covering these features (timezone and DST). The only way we going to able to replicate your issue is by replicating what exactly what you are seeing
Closing this issue since it's become stale. Feel free to open a new issue if your problem persists, and you can provide details on how to reproduce this in a fresh Nova install, or link this issue in your description. Thanks!
Description:
It seems the Value metrics don't respect the users timezone (even though this is set in the serviceprovider). I'm trying to show the number of created users for Today and Yesterday.
This Value metric should show 2 new users for Today and 1 new user for Yesterday. But because of the mysql is in UTC the Value metric is showing 1 new user for Today and 2 new users for Yesterday.
So it seems to respect the mysql timezone (UTC) instead of the nova users timezone (Europe/Amsterdam) which is an 1 hour difference for this case.
For the example; the user with ID 2 was created at 2022-11-04 00:42:33 in the Europe/Amsterdam timezone.
Note: The index view of the resource is showing the corrected (Europe/Amsterdam TZ) created_at timestamps.
Detailed steps to reproduce the issue on a fresh Nova installation:
Create a fresh Nova installation and add a few users to the users table in the database. In the example below I'm showing the ID's with the timestamps. Mysql defaults to UTC timestamps, even though my server (Laravel Forge) timezone is set to
Europe/Amsterdam
.NovaServiceProvider.php (rest of file is default nova)
Nova/Metrics/NewUsers.php (rest of file is default by
php artisan nova:metric NewUsers
)