No timezone information in DateTime dialog | Community
Skip to main content
Level 6
October 16, 2015
Solved

No timezone information in DateTime dialog

  • October 16, 2015
  • 3 replies
  • 1678 views

Hi,

I have a small question about the DateTime widget (http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.form.DateTime).

When we use it in a dialog, it automatically adds the time zone of the browser/user into the field. How do I avoid that?

/Ove

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

CQ widgets can be extended/customized. You can change that widget to meet your business needs. 

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

3 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

CQ widgets can be extended/customized. You can change that widget to meet your business needs. 

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

Ojjis
Level 7
October 16, 2015

This is caused by the fact that DateTime field Widget is using the EXTJs date library (Date.js) which has this behaviour as a default.
And as Scott said, the only way to avoid that is to overlay the standard widget or create you own, it should be possible to return the value without the user/browser time zone. 
JCR is though, as far as i know, limited to store dates strictly in ISO8601 so it might not be possible to go overboard with the creativity in the overlay/custom widget there, but as long as one follows that it should be ok smiley

 

Level 6
October 16, 2015

Good answers. In the end, we realized that we can blissfully ignore the time zone information.

/Ove