The application in which I work has a common date format setting. All pages inherit the following javascript in the header:
$(document).ready(function () {
$(':input[data-datepicker]').datepicker({ dateFormat: 'mm-dd-yyyy' });
});
Now I have a page where I need to add my own properties in Datepicker, for example, get the MaxDate property setting:
Reference:
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.18.min.js")" type="text/javascript">\</script>
.
.
.
$(function () {
$('#addDate').datepicker({ maxDate: 0 });
});
.
.
.
Highlighted HTML:
<input data-datepicker="True" id="addDate" name="Date" type="text" value="" />
Currently, no additional properties that I am adding to $ ('# addDate') are being added. datepicker like MaxDate or defaultDate seems to take effect. Help!
source
share