Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Saving a date value (datetime field) through ajax

Avatar

Level 3

Hi,

I am trying to sync the values of two nodes and both are datetime field. I am using ajax call to set value of another node onsubmit of dialog. Problem is id I save through datetime in dialog it saves with timezone information but if I save it through ajax the date converts into UTC(server is in UTC) format and saves. How can we achieve this without conversion?

1 Accepted Solution

Avatar

Correct answer by
Level 8

When you say you are saving the value through and AJAX call can you be a little more specific? Is your AJAX call targeting custom code you have written or the standard Sling POST servlet? Dialog submits are AJAX calls as well, have you tried comparing the dialog submit POST request with your AJAX request to see if there are any differences? 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 8

When you say you are saving the value through and AJAX call can you be a little more specific? Is your AJAX call targeting custom code you have written or the standard Sling POST servlet? Dialog submits are AJAX calls as well, have you tried comparing the dialog submit POST request with your AJAX request to see if there are any differences?