![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
28/12/2010, 17:16
|
| | Fecha de Ingreso: noviembre-2010 Ubicación: Bogota
Mensajes: 5
Antigüedad: 14 años, 2 meses Puntos: 0 | |
Respuesta: Número de días del mes Esta está mucho mejor, más corta y si no se coloca el año supone el año actual.
function daysInMonth(humanMonth, year) {
return new Date(year || new Date().getFullYear(), humanMonth, 0).getDate();
}
daysInMonth(2, 2009); // 28
daysInMonth(2, 2008); // 29
Fuente: http://blog.scriptia.net/articulos/2009/03/numero-de-dias-en-un-mes.html |