Some of the options you use are not available in datepicker, see http://api.jqueryui.com/datepicker/
And also you are missing $(function () {});. See the updated code below.
$(function () {
$('#DateRangeTo').datepicker({
beforeShow: function (input, inst) {
inst.dpDiv.css({ marginTop: -input.offsetHeight + 'px', marginLeft: input.offsetWidth + 'px' });
},
dateFormat: "dd/mm/yyyy",
onSelect: function (dateText, inst) {
alert("Working");
},
onClose: function (date) {
var dt = new Date(date);
alert(dt.getMonth());
}
});
});
If still not working, check for javascript errors in the error console.
source
share