Handling date values


#1

Hi all,
I’m writing a view that shows two date values that I’d like to put in two <input type=‘date’ …> controls.
I receive the dates via SOAP calls and they are always formatted as ‘yyyy-mm-dd’.
With this format, the input control is not able to parse a date.

How can i handle the change of format to allow both the write and the read in the input control?

Thanks!


#2

Do you have access to the SOAP Webservice?

APIs should provide data in a standardpattern… and for Dates it is the best to use timestamps. So you want have any problems.

To solve your Problem on clientside --> you need to create a new Date-Objekt with the given formatter

new Date('2014-10-31');

after that you can peform all javascript date-functions


#3

Yes, it is a third-part service, I cannot modify it !

Ok, i created the date object but how can i feed the input field with the required format??

How can I handle the value when I read the new value?