Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/04/2013, 13:04
Avatar de catpaw
catpaw
 
Fecha de Ingreso: mayo-2010
Ubicación: xalapa
Mensajes: 856
Antigüedad: 14 años
Puntos: 23
Respuesta: fechas: sumar restar meses (datepicker)

bueno parece que ya funciona, despues de googlear lo que va del dia llegue a este codigo

Código Javascript:
Ver original
  1. $("#fecha_inicio").datepicker({
  2.     dateFormat: 'yymm',
  3.     showOn: "button",      
  4.     buttonImage: "../images_icon/datebox_arrow.png",
  5.     buttonImageOnly: true,
  6.     numberOfMonths: 2,
  7.     onSelect: function(selectedDate){
  8.         var month = selectedDate.substr(4,2);
  9.         var year = selectedDate.substr(0,4);
  10.         $("#fecha_final").datepicker("option", "minDate", new Date(year, month));
  11.         $("#fecha_final").datepicker("setDate", new Date(year, month, 1));
  12.     }
  13. });
  14. $("#fecha_final").datepicker({
  15.     dateFormat: 'yymm',
  16.     showOn: "button",      
  17.     buttonImage: "../images_icon/datebox_arrow.png",
  18.     buttonImageOnly: true,
  19.     numberOfMonths: 2,
  20.     onSelect: function(selectedDate){
  21.         var month = selectedDate.substr(4,2);
  22.         var year = selectedDate.substr(0,4);
  23.         $("#fecha_inicio").datepicker("option", "maxDate", new Date(year, month));
  24.         $("#fecha_inicio").datepicker("setDate", new Date(year, month-1, -1));
  25.     }
  26. });

Aunque encontre la solucion mas al "tin-marin" que por conocimiento de causa, aun necesitare hacer muchas mas pruebas para ver como se comporta.

Si hay alguna otra propuesta es bienvenida