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

144
Visualizações
hotel-datepicker set default date

I am using this datepicker : https://github.com/benitolopez/hotel-datepicker

My datepicker works fine, however, when creating the calendar I would like it to open on a specific month without disabling previous months as long as it is within my startDate and endDate.

I tried changing the startDate and that works, however, it disables all of the months before (saw that in the documentation after the fact). Which is no bueno. I did some googling and found people using a defaultDate for other datepickers but that doesn't seem to do anything. Any help would be appreciated.

var default_date = document.getElementById("start").value;

let datepicker = new HotelDatepicker(document.getElementById(response[0].room + '-datepicker'), {
    format: 'MM-DD-YYYY',
    infoFormat: 'MM-DD-YYYY',
    minNights: 1,
    maxNights: 29,
    disabledDates: lockedDates,
    noCheckInDates: lockedDates,
    startDate: moment().add(1, 'days').format('MM-DD-YYYY'),
    endDate: maxDay,
    defaultDate: default_date,
    enableCheckout: true,
    autoClose: false,
    preventContainerClose: true,
    moveBothMonths: true,
    selectForward: true,
    setValue: function (s, s1, s2) {
      var checkin = new Date(s1);
      var checkout = new Date(s2);
      var checkin_formatted = fecha.format(checkin, 'YYYY-MM-DD');
      var checkout_formatted = fecha.format(checkout, 'YYYY-MM-DD');

      document.getElementById(response[0].room + '-partialcheckin').value = checkin_formatted;
      document.getElementById(response[0].room + '-partialcheckout').value = checkout_formatted;
    }
about 4 years ago · Juan Pablo Isaza
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