how to disable previous date in bootstrap datepicker?

Today, We want to share with you how to disable previous date in bootstrap datepicker.In this post we will show you disable future dates in bootstrap datepicker, hear for bootstrap-datetimepicker disable past time we will give you demo and example for implement.In this post, we will learn about Bootstrap datepicker Disable Past Dates And Time with an example.

how to Disable Previous Date in Bootstrap Datepicker?

Solution:

$('.datepicker').datepicker({ 

    startDate: new Date()

});

index.html

<!DOCTYPE html>
<html>
    <head>
        <title>Bootstrap Datepicker Disable Past Dates Example - www.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 Disable Past Dates Example - www.pakainfo.com</h2>
    <strong>Current Date is 5/7/2020</strong>
    <input type="text" name="date" class="form-control datepicker" autocomplete="off">
</div>
    
</body>
     
<script type="text/javascript">
   
    $('.datepicker').datepicker({ 
        startDate: new Date()
    });
  
</script>
</html>

I hope you get an idea about jquery datepicker | disable dates before today.
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.

Read Also:  Bootstrap Datetimepicker Disable Dates Dynamically

Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  Bootstrap change tooltip content on click jQuery
  2. Read Also:  Bootstrap datepicker Disable Dates Dynamically in jQuery
  3. Read Also:  JQuery Remove combobox items(options) from DropDownList
  4. Read Also:  Jquery Ajax Form Submit with WordPress
  5. Read Also:  how to disable previous date in bootstrap datepicker?
  6. Read Also:  Angular 9/8 Get Selected DropDown Value on Form Submit
  7. Read Also:  how to show multiple checkbox checked in php?
  8. Read Also:  JQuery Ajax Dynamic Treeview using PHP MySQL Example
  9. Read Also:  how to remove html tags from string in php?
  10. Read Also:  jQuery Ajax File Upload in Laravel
CLOSEX