Function-两个日期大小比较

function checkDate(from,to){
if (from == "" || to == "") return 2;
var rValue = 0;
for (var i = 0; i < 10; i++) {
if (from.charAt(i) < to.charAt(i)) {
rValue = 1;
break;
} else if (from.charAt(i) > to.charAt(i)) {
rValue = -1;
break;
}
}
return rValue;
}

posted @ 2016-12-30 09:29  乱笙歌  阅读(253)  评论(0编辑  收藏  举报