Today in the project to meet a more wonderful problem, the same code, under the Android machine can be normal display, but to the Apple machine is alive and well display, and finally positioning, the original iOS system does not support the date format 2017-09-08 , and Android support a number of date formats, display is no problem, look at the conversion code below,
//iterate through the JSON array, get each time to compare with the current time, pass me less than 10 minutes, show is dropping if(NULL! = ItemList && itemlist.length>0){ varCurrentTime =NewDate (); $.each (ItemList,function(I, item) {varTime =Item.time; varstr =time.tostring (); //convert yyyy-mm-dd HH:mm:ss to Yyyy/mm/dd HH:mm:ss varVistertime =NewDate (Str.replace (/-/g, "/")); varHaomiao = Currenttime.gettime ()-Vistertime.gettime (); //one minute is 1000 milliseconds. //This compares the results of the new assignment to time, if true indicates more than 10 minutes, true=1 if(haomiao-10*60*1000>0) {Item.time=0; }Else{item.time= 1;//just dropping by. } }); }
This problem compared pit, in this point to hope you less detours, can smooth the bug out! Come on
iOS does not support date formats for 2017-09-09