PDA

View Full Version : Date.dateParse issue



vaduros
21 Apr 2007, 8:33 PM
I'm having a weird issue here trying to use parseDate in on of my rendering functions. What I have is a string with one to three dates separated by "|" that I'm going to split and format.



function renderValDates(value){
isodate = value.split("|");
if (isodate[0] != ''){
kdat = Date.parseDate(isodate[0],'d-m-Y');

...
}


Even if I have some date like '2002-05-27 00:00:00' for isodate[0] (verified by firebug), the result for kdat stays null.

Any hint what's going on here?

tryanDLS
22 Apr 2007, 10:48 AM
You need to pass a format string that matches your string input. You're telling it to expect a date in d-m-Y format, but you're passing something different.

vaduros
22 Apr 2007, 2:30 PM
Ups, apparently I misunderstood the purpose of the dateParse method...8-(