I am using bootstrap date picker in my HTML web page and I want to disable past dates from current dates. How can I use this formate.
My code is:
<script type="text/javascript"> $(function () { $("#date_picker").datepicker({ format: "dd/mm/yy", showOtherMonths: true, selectOtherMonths: true, autoclose: true, changeMonth: true, changeYear: true }); }); </script>
Yes you can disable past dates from current dates using bootstrap datepicker. Follow this example code.
I also done this using this code. I am using this css and js link for display bootstrap datepicker. You can use this css and js link.
CSS Link:
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
JS Link:
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
Datepicker Input Field:
<input id="date_picker" name="date_picker" type="text" class="col-sm-8">
jQuery Code:
For disable past dates from current dates apply this code on your HTML web page
<script type="text/javascript"> $(function () { $("#date_picker").datepicker({ format: "dd/mm/yy", showOtherMonths: true, selectOtherMonths: true, autoclose: true, changeMonth: true, changeYear: true, orientation: "top", minDate:new Date() }); }); </script>
Question and answer is powered by AnsPress.io