输入小的日期:
1 var aStr = "2015-02-22".split("-"); 2 var aEnd = "2015-03-22".split("-"); 3 4 var arr = [aStr,aEnd]; 5 6 arr.sort(function(a1,a2){ 7 for(var i=0; i
朋友告诉我直接比较,
1 var aStr = "2015-02-22".split("-").join("");2 var aEnd = "2015-03-22".split("-").join("");3 //比较4 parseInt(aStr)-parseInt(aEnd);
我瞬间感觉白忙活了。。。哭死