Determining Date Equality in Javascript
问题 I need to find out if two dates the user selects are the same in Javascript. The dates are passed to this function in a String ("xx/xx/xxxx").That is all the granularity I need. Here is my code: var valid = true; var d1 = new Date($('#datein').val()); var d2 = new Date($('#dateout').val()); alert(d1+"\n"+d2); if(d1 > d2) { alert("Your check out date must be after your check in date."); valid = false; } else if(d1 == d2) { alert("You cannot check out on the same day you check in."); valid =