<script type="text/javascript" language="javascript">
$(document).ready(function () {
$(function () {
$(".datepicker").datepicker({
dateFormat: "mm/dd/yy",
changeMonth: true,
changeYear: true
});
});
});
</script>
I used the above code to show date in datepicker but the the date is set jan 2001. how do I set the DateTime to today as default in above jquery. before i put the jquery in editor templates it worked fine.
It should be the default behavior according to jQuery UI documentation. When the
defaultDateoption isnullas it is by default, today’s date should be highlighted on first opening. Perhaps your system time is incorrect? Here’s a codepen where I tried it and it seemed to be showing today’s date by default.