不知何故,firefox對于類似“2010-12-20 15:55:00”這種時間的轉換格式不感冒,傳回nan,查了查資料,把“-”替換為“/”就可以了;
<mce:script type="text/javascript"><!--
var inputdate="2010-12-20 15:55:00";
inputdate=inputdate.replace("-", "/").replace("-", "/");
var nowdate=new date();
//alert(date.parse(inputdate))
//alert(date.parse(nowdate))
if(date.parse(inputdate)<date.parse(nowdate))
{
alert("對不起,輸入時間不能晚于目前時間!");
}
// --></mce:script>