$(".datagrid-row").each(function(index, element){
var id = $(this).attr("id");
var dates = $("#"+id+" .StartDatetext, #"+id+" .EndDatetext").datepicker({
minDate: '0',
maxDate: '10000D',
dateFormat: "MM dd yy",
onSelect: function (selectedDate) {
var option = this.id == ".EndDatetext" ? "maxDate" : "minDate",
instance = $(this).data("datepicker"),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings);
var odate = date;
if (this.id == "StartDatetext") {
odate.setDate(odate.getDate() + 1);
}
dates.not('.StartDatetext').datepicker("option", option, odate);
}
});
});
No comments:
Post a Comment