Saving a date value (datetime field) through ajax | Community
Skip to main content
-Dipen-
Level 2
October 16, 2015
Solved

Saving a date value (datetime field) through ajax

  • October 16, 2015
  • 1 reply
  • 802 views

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?

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 PaulMcMahon

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? 

1 reply

PaulMcMahonAccepted solution
Level 8
October 16, 2015

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?