
20-10-2007, 23:27
|
|
|
|
חבר מתאריך: 11.09.04
הודעות: 1,032
|
|
בוא נייעל את זה עוד קצת....
קוד:
function checkDate(sDate){
if(/([0-9]{1,2})\-([0-9]{1,2})\-([0-9]{4})/.test(sDate)){
var diff = sDate.replace(/([0-9]{1,2})\-([0-9]{1,2})\-([0-9]{4})/, "$3, $1, $2");
var myDate = new Date(diff);
var today = new Date();
if(myDate<today){
alert("The inputed date occures before the current date");
return false;
}
alert("OK") //return something
}else{
alert("Date Is Invalid, Please Select a Vaild Date");
return false;
}
}
checkDate("11-21-2007");
_____________________________________
|