Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
How to allow the bootstrap datepicker, range between current date to next 3 months only in Jquery

I'm trying to allow the the date only from current date to next 3 months in bootstrap datepicker but i am unable to find the solution's any one can please help me on it.

I have two date pickers like start date and end-date but date should be able to select only current date and it must allow only 3 months from current date. please show me an example in Jsfiddle.

   $("#startdate").datepicker({
isDisabled: function(date) {
    var d = new Date(); 
    return date.valueOf() < d.setMonth(d.getMonth()+3) ? false : true;
},
autoClose: true,
viewStart: 0,
weekStart: 1,
maxDate: 0,
dateFormat: "dd/mm/yyyy"
})
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script>

<div class="container">
  <div class="row">
    <div class="col-md-3">
      <div class="form-group ">
        <label for="" class="required">Start Date</label>
        
        <div class="input-group date" data-provide="datepicker">
          <input style="width:250px;" type="text" placeholder="select task start date" id="stdate" class="form-control">
          
          <div class="input-group-addon">
            <span class="glyphicon glyphicon-th"></span>
          </div>
        </div>
      </div>
    </div>

    <div class="col-md-3">
      <div class="form-group">
        <label for="" class="required">End Date</label>
        
        <div class="input-group date" data-provide="datepicker">
          <input style="width:250px;" type="text" placeholder="select task cutoff date" id="enddate" class="form-control">
          
          <div class="input-group-addon">
            <span class="glyphicon glyphicon-th"></span>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!