0

I have the following code that works on a desktop in chrome, firefox and MS edge but I get different results on a smart phone (IPHONE 6 IOS) using either safari or chrome.

Here's the code and the results:

for (j= 0;j<allcnt;j++){

          resdates[j] = false;
          resdate = new Date(allresx[j].date + ' 00:00:00');
          resmth = resdate.getMonth() + 1 ;
          resday = resdate.getDate()  ;
          $("#wx" + j).hide();
          document.write(allresx[j].date + ' 00:00:00 |');
          document.write(resmth + ' | ');              
          document.write(resday + ' | ');
          document.write('<br>');
      }

on the desktop I'm getting:

2017-05-30 00:00:00 |5 | 30 | 
2017-06-01 00:00:00 |6 | 1 | 
2017-06-04 00:00:00 |6 | 4 | 

which is what I expected

on the smartphone I'm getting:

2017-05-30 00:00:00 |NaN | NaN | 
2017-06-01 00:00:00 |NaN | NaN | 
2017-06-04 00:00:00 |NaN | NaN | 
DCR
  • 14,737
  • 12
  • 52
  • 115

0 Answers0