This is my coding from javascript but it did't work
if ( $("#requestDueDate").val().length < CurDate ) {
alert("Due date should be more than current date");
setBoolean = false;
return false;
}
Thank you.
This is my coding from javascript but it did't work
if ( $("#requestDueDate").val().length < CurDate ) {
alert("Due date should be more than current date");
setBoolean = false;
return false;
}
Thank you.
Convert the string to a date:
// Expect d/m/yyyy
function toDate(s) {
s = s.split(/\D/g);
return new Date(s[2],--s[1],s[0]);
}
Then compare to the current date:
function afterNow(s) {
var now = new Date();
return +toDate(s) > +now;
}
Try it:
afterNow('9/10/2013'); // false
afterNow('9/10/2031'); // true