Today, We want to share with you bootstrap datepicker disable past dates.In this post we will show you datetimepicker disable past dates and time, hear for how to set bootstrap datetimepicker deactivate past dates and time we will give you demo and example for implement.In this post, we will learn about Bootstrap Datetimepicker deactivate Dates Dynamically with an example.
Bootstrap Datepicker Disable Past Dates Example
Solution:-
$('.datepicker').datepicker({ startDate: new Date() });
Example 1: index.html
<!DOCTYPE html> <html> <head> <title>Bootstrap Datepicker deactivate Past Dates Example - pakainfo.com/</title> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.css"> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.css"> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Bootstrap Datepicker deactivate Past Dates Example - pakainfo.com/</h2> <input type="text" name="date" class="form-control datepicker" autocomplete="off"> </div> </body> <script type="text/javascript"> $('.datepicker').datepicker({ startDate: new Date() }); </script> </html>
Bootstrap Datetimepicker Disable Past Dates And Time Example
Example 2: index.html
<!DOCTYPE html> <html> <head> <title>datetimepicker deactivate past dates and time - pakainfo.com</title> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> </head> <body> <div class="container"> <h2>datetimepicker deactivate past dates and time - pakainfo.com</h2> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <script type="text/javascript"> $(function () { $('#datetimepicker1').datetimepicker({ minDate:new Date() }); }); </script> </div> </div> </body> </html>
I hope you get an idea about bootstrap datepicker deactivate specific dates.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.