hi here is how i do to set start date cannot be after end date $("#startId, #endId").datepicker({ beforeShow : function(input) { return { 'minDate' : (input.id == 'endId' ? $('#startId').datepicker('getDate') : null), 'maxDate' : (input.id == 'startId' ? $('#endId').datepicker('getDate') : null) }; } })
basically you have to modify the date after you get the date from datepicker hope it help you get started