2012-07-04 24 views

Respuesta

3

Ésta es la forma en que puede hacerlo ...

Conseguir el último día durante un año y mes determinado:

function getLastDayOfYearAndMonth(year, month) 
{ 
    return(new Date((new Date(year, month + 1, 1)) - 1)).getDate(); 
} 

Comprobar con beforeShowDay evento si la fecha es el último día mes:

$('.selector').datepicker(
{ 
    beforeShowDay: function(date) 
    { 
     // getDate() returns the day [ 0 to 31 ] 
     if (date.getDate() == 
      getLastDayOfYearAndMonth(date.getFullYear(), date.getMonth())) 
     { 
      return [true, '']; 
     } 

     return [false, '']; 
    } 
}); 
+0

¡Muchas gracias! – XTN

+0

Esto funcionó perfecto! Gracias – ScottyG

Cuestiones relacionadas