2012-07-04 11 views

risposta

3

In questo modo si può fare ...

Ottenere l'ultimo giorno per un determinato anno e mese:

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

Verificare con beforeShowDay evento se la data è l'ultimo giorno mese:

$('.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

Grazie mille! – XTN

+0

Questo ha funzionato perfettamente! Grazie – ScottyG

Problemi correlati