Bootstrap Datepicker Disable Past Dates Example

Share Me
  •  
  •  
  •  
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share
Bootstrap Datepicker Disable Past Dates

Hello Dev’s
Today In this example,i will show you how to disable past dates in bootstrap datepicker. So now simply you can learn from here how to disable past dates in boostrap datepicker.Here we know Bootstrap Datepicker Disable Past Dates.

Bootstrap Datepicker Disable Past Dates

Solution:-

$('.datepicker').datepicker({ 
    startDate: new Date()
});	

Example:-

<!DOCTYPE html>
<html>
<head>
    <title>Bootstrap Datepicker Disable Past Dates Example - CodingsPoint.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">
    <h1>Bootstrap Datepicker Disable Past Dates Example - nicesnippets.com/</h1>
    <input type="text" name="date" class="form-control datepicker" autocomplete="off">
</div>
  
</body>
   
<script type="text/javascript">

$('.datepicker').datepicker({ 
    startDate: new Date()
});
</script>
</html>

Read Also : How to Disabled Specific dates and Friday,Saturday In Bootstrap Datepicker ?

Thanks for read. I hope it help you. For more you can follow us on facebook.

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →