Organizational Research By

Surprising Reserch 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
140 views



Related Hot Questions

10 Answers

0 votes
NULL
answered Sep 22, 2015 by shikhar jain
0 votes
NULL
answered Sep 22, 2015 by yashwantpinge
0 votes
NULL
answered Sep 22, 2015 by deepak gupta
0 votes
NULL
answered Sep 22, 2015 by mtabakade
0 votes
NULL
answered Sep 22, 2015 by dhananjayksharma
0 votes
NULL
answered Sep 22, 2015 by balvant maurya
0 votes
NULL
answered Sep 22, 2015 by ukohale
0 votes
NULL
answered Sep 22, 2015 by suyesh.lokhande
0 votes
NULL
answered Sep 22, 2015 by tseetha
0 votes
NULL
answered Sep 22, 2015 by tejas lakhani

...