<script>
dfrom = datefrom.split("/");
dto = dateto.split("/");
//Checking Year Part;
if(parseInt(dfrom[2]) > parseInt(dto[2])){
alert("DateFrom Cannot greater than DateTo");
return false;
}
if((parseInt(dfrom[1]) > parseInt(dto[1])) && parseInt(dfrom[2]) == parseInt(dto[2])){
alert("DateFrom Cannot greater than DateTo");
return false;
}
if(parseInt(dfrom[0]) > parseInt(dto[0]) && (parseInt(dfrom[1]) == parseInt(dto[1])) && parseInt(dfrom[2]) == parseInt(dto[2])){
alert("DateFrom Cannot greater than DateTo");
return false;
}
</script>
これは日付を比較するスクリプト コードであり、正常に動作していますが、2013 年 7 月 4 日と 2013 年 8 月 4 日を確認すると、「DateFrom は DateTo を超えることはできません」と表示され、これらの日付のみが間違った結果を示しています。私のスクリプトまたは何かにエラーはありますか?
どんな助けも非常に高く評価されます。