$(document).ready(function () {
var dates = $(".txtDateRangeOne, .txtDateRangeTwo").datepicker({
showOtherMonths: true,
selectOtherMonths: true,
showOn: "both",
showAnim: "slide",
showButtonPanel: true,
changeMonth: true,
changeYear: true,
numberOfMonths: 2,
buttonImageOnly: true,
onSelect: function (selectedDate) {
var option = this.className.indexOf("txtDateRangeOne") >= 0 ? "minDate" : "maxDate";
instance = $(this).data("datepicker"),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings);
dates.not(this).datepicker("option", option, date);
}
});
});