Skip to main content
Oct 16, 2015 2:26 AM UTC
Solved

how to get client timezone in datetime widget?

Hi I have a widget with the datetime form on it but it only takes the timezone of the server therefore always giving me not the time I need.

What can I do in order to get the client's timezone information?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Oct 16, 2015 2:26 AM UTC

Extend the widget and use JavaScript logic to get that value. There is quite a bit information on the web that talks about using JavaScript to get the client timezone. For example:

http://stackoverflow.com/questions/1091372/getting-the-clients-timezone-in-javascript

For information about extending a CQ widget -- see: 

http://dev.day.com/docs/en/cq/current/developing/widgets.html

Hope this helps

2 replies

Oct 16, 2015 2:26 AM UTC

Thanks! Do you happen know where else there is another tutorials on extending CQ widgets? I find that the documentation found on that particular page to be difficult to understand for an up and learning CQ developer such as myself. smiley

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Oct 16, 2015 2:26 AM UTC

Extend the widget and use JavaScript logic to get that value. There is quite a bit information on the web that talks about using JavaScript to get the client timezone. For example:

http://stackoverflow.com/questions/1091372/getting-the-clients-timezone-in-javascript

For information about extending a CQ widget -- see: 

http://dev.day.com/docs/en/cq/current/developing/widgets.html

Hope this helps

Translate