To set default date to current date in datepicker. Follow this example code
1
2
3
4
5
6
<script type="text/javascript"> $('#datedatepick').datepicker({ // #datedatepick is the input field ID name format: "yyyy/mm/dd", defaultDate: new Date(), }); </script>
For example:
full version.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script type="text/javascript"> $('#datedatepick').datepicker({ format: "yyyy/mm/dd", autoclose: true, todayHighlight: true, showOtherMonths: true, selectOtherMonths: true, autoclose: true, defaultDate: new Date(), changeMonth: true, changeYear: true, orientation: "button" }); </script>
Question and answer is powered by AnsPress.io