Hi to everybody! I want to compare current date (server date) to the date inputted by the user. It should detect if inputted date is earlier than or equal to the current date.
For example:
Current date is 3/6/3008
Inputted Date by the user is 03/05/2008
Below is my function:
Please help me. Thanks in advance and More Power!
For example:
Current date is 3/6/3008
Inputted Date by the user is 03/05/2008
Below is my function:
Code:
function checkDateInput(dateString){
var error="";
with(currDate){
currDate = getMonth()+1+"/"+getDate()+"/"+getFullYear();
}
if(dateString != ""){
if(currDate >= dateString){
error = "Publication Date must not earlier than or equal to current date.";
return error;
}
}
return error;
}
Comment