Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


javascript dates in ie nan firefox chrome ok


javascript dates in ie nan firefox chrome ok  using -'javascript,internet-explorer,date'

I'm trying to build a little calendar in javascript, and I've got my dates working great in Firefox and chrome, but in IE, the date functions are returning NAN.

Here is the function


function buildWeek(dateText){
            alert(dateText);
            var headerDates='';
            var newDate = new Date(dateText);
            var startSched=formatDates(newDate);

            newDate.setDate(newDate.getDate()-1);

            for(var d=0;d';
            newDate.setDate(newDate.getDate()+5);
            newDate.setDate(newDate.getDate()+1);
            var theseDates=formatDates(newDate);
            headerDates+=''+theseDates[1][0]+'';
            if(d==6){
            newDate.setDate(newDate.getDate()+2);
            theseDates=formatDates(newDate);
            headerDates+='>';                }
                            }                       
        jQuery('div#headerDates').html(''+headerDates+'');
                                }


The datetext is the monday of the current week which is actually set in php in the format of 'm, d, Y'.

Eg (02, 01, 2010);
    

asked Sep 22, 2015 by girisha
0 votes
136 views



Related Hot Questions



Government Jobs Opening


...