Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda