Ver Mensaje Individual
  #5 (permalink)  
Antiguo 12/04/2013, 11:58
alex1084
 
Fecha de Ingreso: abril-2008
Ubicación: El Salvador
Mensajes: 736
Antigüedad: 16 años, 1 mes
Puntos: 47
Respuesta: como hacer un calendario y validarlo

Si ocupas Datepicker de JQuery UI puedes hacerlo asi, yo asi lo hago

Código PHP:
Ver original
  1. $(function() {
  2.     /*Para obtener los datos de fecha actual*/
  3.     var fecha = new Date();
  4.     var dia= fecha.getDay();
  5.     var mes= fecha.getMonth();
  6.     var anio= fecha.getFullYear();
  7.    
  8.    
  9.     $("#desde").datepicker({
  10.         defaultDate: "+1w",
  11.         changeMonth: true,
  12.         changeYear: true,
  13.         minDate: new Date(2010,1,1), //la fecha minima sera el 01/01/2010
  14.         maxDate: new Date(anio,mes,dia), //La maxima la fecha actual
  15.         numberOfMonths: 1,
  16.         onSelect: function(selectedDate) {
  17.             $( "#hasta" ).datepicker("option", "minDate", selectedDate );
  18.         }
  19.     });
  20.     $("#hasta").datepicker({
  21.         defaultDate: "+1w",
  22.         changeMonth: true,
  23.         changeYear: true,
  24.         numberOfMonths: 1,
  25.         minDate: new Date(2010,1,1), //la fecha minima sera el 01/01/2010
  26.         maxDate: new Date(anio,mes,dia), //La maxima la fecha actual
  27.         onSelect: function( selectedDate ) {
  28.             //$( "#desde" ).datepicker( "option", "maxDate", selectedDate );
  29.         }
  30.     });
  31. });