Description : This javascript code checks whether the checkDate is between beginDate and endDate and generates a MessabeBox
function dateWithin(beginDate,endDate,checkDate) { var b,e,c; b = Date.parse(beginDate); e = Date.parse(endDate); c = Date.parse(checkDate); if((c <= e && c >= b)) { return true; } return false; }
// This will alert 'false' alert(dateWithin('12/20/2007 12:00:00 AM','12/20/2007 1:00:00 AM','12/19/2007 12:00:00 AM'));
Thanks
Happy Programming.
|
No responses found. Be the first to respond and make money from revenue sharing program.
|