function CompareDate(epr_departuredate,epr_returneddate) {
var epr_departuredate = new Date(24,11,2016); //Today Date
var epr_returneddate = new Date(25,11,2016);
if (epr_departuredate >epr_returneddate) {
alert("Departure Date Cannot Late Than Return Date. Please Check");
}else {
alert("Date You Enter is Valid. Please Continue.");
}
}
爲什麼我的代碼不工作,只顯示:出發和返回的日期
出發日期不能遲到總比不到返程日期。請檢查。
當我跑步。我只想比較出發日期和返回日期。
這是'新的日期(年,月[日期[,小時,分鐘,秒[毫秒]]]]]);'[來源] (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)] –