나름 프로그래밍?/실용 유용한 팁
[Javascript] 해당 월의 일수 구해오기
-Dong-
2011. 12. 8. 18:30
32 - new Date(year, month, 32).getDate()
위 코드를 쓰면 윤년도 계산 가능!
function fn_DayOfMonth(year, month)
{
//month 는 0 부터 시작해서..
return 32 - new Date(year, month-1, 32).getDate();
}
}