jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
695 stars 125 forks source link

Use browser timezone if user timezone is not set #3551

Closed knstvk closed 1 month ago

knstvk commented 3 months ago

Currently for the standard scaffolded User entity that implements HasTimeZone the browser timezone is ignored even when the user timezone is not set. See https://github.com/jmix-framework/jmix/blob/49e8076cdcd2925a39bf0c0c23848c666705f4b5/jmix-core/core/src/main/java/io/jmix/core/security/impl/CurrentAuthenticationImpl.java#L118-L125

So setting timezone in ClientDetails by LoginViewSupport is currently useless.

The browser timezone should be used if the user timezone is not set. Consider also introducing the autoTimeZone attribute in the User entity to control whether the browser timezone should be used (or a special value in the timezones list to not change the model).

SergeiAksenov2 commented 1 month ago

Tested on: Jmix version: 2.4.999-SNAPSHOT Jmix Studio plugin version: 2.4.SNAPSHOT6866-242 IntelliJ version: IntelliJ IDEA 2024.2.3 (Community Edition)