Ver Mensaje Individual
  #8 (permalink)  
Antiguo 27/06/2015, 13:28
Avatar de xfxstudios
xfxstudios
 
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 10 meses
Puntos: 263
Respuesta: APORTE Validar Fecha con DatePicker

paso 7:
Funcion datepicker que bloquea las fechas recibidas:
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. $(function() {
  3.     $( "#Datepicker1" ).datepicker({
  4.         autoSize: true,
  5.             dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
  6.             dayNamesMin: ['Dom', 'Lu', 'Ma', 'Mi', 'Je', 'Vi', 'Sa'],
  7.             firstDay: 1,
  8.             monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
  9.             monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'],
  10.             dateFormat: 'yy-mm-dd',
  11.             minDate: 0,
  12.             beforeShowDay: checkAvailability,
  13.             changeMonth: true,
  14.             /*numberOfMonths: 2,
  15.             showButtonPanel: true*/
  16.             /*changeYear: true*/
  17.             });
  18. var $myBadDates = new Array(<?php echo $dispo_json ?>);
  19.     function checkAvailability(mydate){
  20.     var $return=true;
  21.     var $returnclass ="available";
  22.     $checkdate = $.datepicker.formatDate('yy-mm-dd', mydate);
  23.     for(var i = 0; i < $myBadDates.length; i++)
  24.         {    
  25.            if($myBadDates[i] == $checkdate)
  26.               {
  27.             $return = false;
  28.             $returnclass= "unavailable";
  29.             }
  30.         }
  31.     return [$return,$returnclass];
  32.     }
  33. });
  34. </script>
espero les sirva....