Jquery two different date validation

var cin = $ ("# datepicker"). val (); var cout = $ ("# datepicker2"). val (); dateformat: dateFormat: 'DD, d MM, yy'

how can i use jquery to check the cin (checkin) date and not the cout (checkout) date? which means the cout date cannot be earlier than the cin date

+2


a source to share


1 answer


I don't know what your datepicker is, but if it is a JQuery-datepicker then it is better to get the date from .datepicker("getDate")

. Then you should have JS Date objects that can be compared to regular numbers (see http://www.w3schools.com/js/js_obj_date.asp )



+1


a source







All Articles