Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

No timezone information in DateTime dialog

Ove_Lindström
Level 6
Level 6

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

1 Accepted Solution
smacdonald2008
Correct answer by
Level 10
Level 10

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.

View solution in original post

3 Replies
smacdonald2008
Correct answer by
Level 10
Level 10

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.

View solution in original post

Ojjis
Level 7
Level 7

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

 

Ove_Lindström
Level 6
Level 6

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

/Ove