0

necesito deshabilitar de un calendario 5 días antes de una fecha dada. El código que tengo es el siguiente:

<input type="text" name="fecha_interconsulta" id="fecha_interconsulta" size="12" tabindex="4" maxlength="10" class="iconocal datepicker" value="<?php echo $fecha_hoy; ?>" />
    $('.datepicker').datepicker({
                    //OPCIONES EN https://bootstrap-datepicker.readthedocs.io/en/latest/options.html
                    startDate:"-30d",
                    endDate:"0",
                    assumeNearbyYear: true,
                    format: "dd/mm/yyyy",
                    language: "es",
                    daysOfWeekHighlighted: "1,2,3,4,5",
                    todayHighlight: true,
                    autoclose: true,
                    clearBtn:false,
                    todayBtn:false,
                    todayHighlight:true,
     beforeShow : function(){
            var dateTime = new Date('<?php echo $fecha_valida;?>');
            // hacer algo acá al medio
                $(this).datepicker( "option", "minDate", "-5" );

        } 
    });
8

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.