Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/07/2012, 15:28
Avatar de Lerolero
Lerolero
 
Fecha de Ingreso: junio-2012
Mensajes: 18
Antigüedad: 12 años, 10 meses
Puntos: 0
Jquery datepicket no funciona ie8

Hola,

Tengo la siguiente función, lo que hace es generar un calendario y resaltar los días en que halla fechas, algo así como un calendario de eventos, funciona bien en chrome, pero en ie8 no se ve nada, y en mozilla se ve el calendario con los días resaltados pero no funciona el alert. Que puede ser??

Código Javascript:
Ver original
  1. $(document).ready(function () {
  2.          var events = [
  3.           <?php
  4.           $obj_agenda=new sQuery(); //Instanciamos la clase
  5.           //Ejecuta la consulta para mostrar la fecha
  6.           $query = 'SELECT age_fecha_compromiso, nombre FROM t_agenda, t_asunto WHERE t_agenda.activo_id=2';
  7.           $result = $obj_agenda->executeQuery($query);
  8.           // Recorremos todos los registros que haya soltado el query
  9.            while($row = mysql_fetch_array($result)) {
  10.                   $fecha = date_create($row['age_fecha_compromiso']);
  11.                   $fecha = date_format($fecha, 'm/d/Y');
  12.                   $titulo =  $row['nombre'];
  13.           ?>
  14.           { Title: "<? echo $titulo;  ?>", Date: new Date("<? echo $fecha;  ?>") },
  15.          <?php
  16.         }
  17.        ?>
  18.       ];
  19.        
  20.        $('#datepicker').datetimepicker({
  21.         showSecond: true,
  22.         timeFormat: 'hh:mm:ss',
  23.        
  24.         beforeShowDay: function(date) {
  25.         var result = [true, '', null];
  26.         var matching = $.grep(events, function(event) {
  27.             return event.Date.valueOf() === date.valueOf();
  28.         });
  29.        
  30.         if (matching.length) {
  31.             result = [true, 'highlight', null];
  32.         }
  33.         return result;
  34.     },
  35.     onSelect: function(dateText) {
  36.         var date,
  37.             selectedDate = new Date(dateText),
  38.             i = 0,
  39.             event = null;
  40.        
  41.         while (i < events.length && !event) {
  42.             date = events[i].Date;
  43.  
  44.             if (selectedDate.valueOf() === date.valueOf()) {
  45.                 event = events[i];
  46.             }
  47.             i++;
  48.         }
  49.         if (event) {
  50.             alert(event.Title);
  51.         }
  52.     }
  53.     });