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

199
Visualizações
bootstrap jquery datepicker disable all dates with exception and id

I need the help of a jquery guru :)

I'm trying to teach myself some javascript (bootstrap datepicker), but I'm failing because of the following:

I am currently reading the blocked days (json format) from a file use it as blocked dates in my datepicker, it works great:


javascript code:

 $("#picker1").datepicker({
            autoclose: true,
            updateViewDate: false,
            daysOfWeekDisabled: [0,6],
            startDate: '+1d'
        }).on('show', function(e) {
            var setid = 12;
            var pickedMonth = new Date(e.date).getMonth() + 1;
            var pickedYear = new Date(e.date).getFullYear();  
            $.ajax({
                url: 'get_block_date.php',
                data:'sid='+ setid + '&m='+pickedMonth+'&y='+pickedYear,
                dataType: 'JSON',
                type: 'POST'
            })
                .done(function( response ) {
                    
                    $('#picker1').datepicker("setDatesDisabled", response.disableDates);
                })
                .fail(function(response, jqxhr, textStatus, error) {

                 $('#picker1').datepicker('remove');
                 alert('loading blockeddates failed');   

            }); 
            
        }).on('changeMonth', function (e) {

    
         }).on('changeDate', function(e) {

        });

the json looks like this:

[ "2021-09-30", "2021-10-01", "2021-10-02", "2021-10-03", "2021-10-04" ]

my question:

now I would like to turn it around:

I have a new json file in which the days are listed which should be the only ones activated AND i have a separator next to the date for an special id. if the dates is chosen, the id should be able to be processed.

my json file:

[ "2021-09-29|2", "2021-09-28|3", "2021-09-27|2" ]

my task:

  • every day except for those should be blocked, every month the list should be queried again
  • it should be the parameter after the separator | further processed via javascript.

hope you help me ;) Thanks!

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