I'm working with javascript Date and i'm starting to go crazy :)
I want two compare only the year,month, day of two dates. The date are (retrieve from firebug stacktrace):
[Date {Thu Feb 11 2010 12:00:00 GMT+0000 (GMT Standard Time)}]
[Date {Sun Jul 11 2010 00:00:00 GMT+0100 (GMT Daylight Time)}]
In this point i'm trying compare the two dates like this:
if (datepickerBegin == null || datepickerBegin.length == 0 || datepickerBegin != date) {
//Do stuff
}
This code obvious doesn't work, which is the simple way of comparing these two String?
I'm trying to convert this var to Date and concatenate into another var the getMonth()+getYear()+getDay()
... but
i believe that there is a easiest way.
By the way, why the following line give NaN
new Date(datepickerBegin).getMonth()
but the following line works?
new Date(Date.parse(datepickerBegin.toString())).getMonth()