Objective:
To help customers make an order system, a date of 1, a date of 2, by default, the date 1 is the day, the date 2 for tomorrow, but some doubts that the date 2 occasionally appear Nan, Today I saw the same problem in segmentfault.com, so I think it is necessary to revisit the problem at that time. Do a good job.
<!--date () NAN start-->
The following code is a problem, not recommended for direct use, just temporary version, subsequent modification
<! DOCTYPE html>"en">"UTF-8"> <title>date NaN undefined</title>"Today"></div> <div id="NextDay"></div> <script>varmonth = { "Jan":" on", "Feb":" Geneva", "Mar":"Geneva", "APR":"Geneva", " May":" to", "June":" .", "Jul":" -", " the":" ,", "Sep":" the", "Oct":"Ten", "Nov":" One", "Dec":" A" }; function GetDate (e) {varD,thedate,array; if(e.time) {varArray =E.time.split (E.symbol); D=NewDate (array[0]+e.symbol+array[1]+e.symbol+ (parseint (array[2])+E.N) ;//There is a serious problem here (this code cannot be used directly)}Else{d=NewDate (); } Array= D.todatestring (). Split (" "); returnarray[3]+e.symbol+month[array[1]]+e.symbol+array[2]; } Today= GetDate ({"symbol":"/"}); document.getElementById ("Today"). InnerHTML =today; document.getElementById ("NextDay"). InnerHTML = GetDate ({"symbol":"/"," Time": Today, "n": 1}); </script></body>Reason: mainly because IE under only support "/" delimiter.