function dateCompare(startStr,endStr)
{
var d1, d2, s, arr, arr1, arr2;
if(startStr.length > 10)
{
arr = startStr.split(" ");
arr1 = arr[0].split("-");
arr2 = arr[1].split(":");
d1 = new Date(arr1[0], arr1[1] - 1, arr1[2], arr2[0], arr2[1], arr2[2]);
}
else
{
arr = startStr.split("-");
d1 = new Date(arr[0], arr[1], arr[2]);
}
if(endStr.length > 10)
{
arr = endStr.split(" ");
arr1 = arr[0].split("-");
arr2 = arr[1].split(":");
d2 = new Date(arr1[0], arr1[1] - 1, arr1[2], arr2[0], arr2[1], arr2[2]);
}
else
{
arr = endStr.split("-");
d2 = new Date(arr[0], arr[1], arr[2]);
}
s = d2 - d1 ;
if(s < 0)
{
return false;
}
return true;
}
阅读(4959) | 评论(0) | 转发(0) |