Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

138
Visualizações
Limit the Two DatePicker within a month using Bootstrap DateTimePicker in Javascript

How to select the two datepicker within a month?

I'm currently using JavaScript and Bootstrap Datepicker.

I found a working two datepicker limit within a month but not working in bootstrap-datepicker because he use other datepicker plugin.

Here's the link http://jsfiddle.net/cse_tushar/2s8XL/

Here's my code.

  $(document).ready(function() {
    $('.startDateTime').datetimepicker({
      format: 'MMMM DD, YYYY',
      icons: {
        previous: "fa fa-chevron-left",
        next: "fa fa-chevron-right",
      },
    });

    $('.endDateTime').datetimepicker({
      format: 'MMMM DD, YYYY',
      icons: {
        previous: "fa fa-chevron-left",
        next: "fa fa-chevron-right",
      },
    });
    
     $(".startDateTime").on("dp.change", function(e) {
      $('.endDateTime').data("DateTimePicker").minDate(e.date);
    });

    $(".endDateTime").on("dp.change", function(e) {
      $('.startDateTime').data("DateTimePicker").maxDate(e.date);
    });
    
  });
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/css/bootstrap-datetimepicker.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js"></script>


<input type="text" id="from_period" class="form-control startDateTime" placeholder="FROM" style="font-weight: bold;">
  
  
 <input type="text" id="to_period" class="form-control endDateTime" placeholder="TO" style="font-weight: bold;">

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda