Use client time zone for CMS

Hello guys,

I faced with the issue that org.hippoecm.frontend.plugins.reviewedactions.dialogs.DatePickerComponent (Schedule Publish\Unpublish) shows incorrect current time (it shows cuurent server time).
After some investigation, I noticed that UserSession.get().getClientInfo().getProperties().getTimeZone() is not set. To set client time zone I can use:

1st approach is not working for me as I am using SSO integration and dont have default login page.
2nd approach seems not working with Bloomreach Expirience (I have an error screen in login page).

I think that I can retrieve time zone thru the JavaScript but where is a proper place to integrate it?

Is there something that I can do to set correct time zone based on client location?

Thanks, Mykyta

Any solution for that?

You could try setting:
UserSession.get().getClientInfo().getProperties().setTimeZone(timeZone);

If you’re using SSO you likely have some filter that acts when the authentication is happening. That would probably be the place. I don’t know that this will work, but it is something to try.

If I am not misteken, it was fixed by overriding org.hippoecm.frontend.plugins.cms.root.RootPlugin. and adding behavior. Behavior that collects the information to populate WebClientInfo’s ClientProperties by using Ajax.

image

1 Like