Flex / AIR / AS
[AS3.0] 각 달의 마지막 날짜 구하기
타울
2009. 8. 11. 21:54
var LastDayOfMonth:Number = new Date(2008, 3, 0).getDate() as Number;
//Trace should yield 31
trace(LastDayOfMonth);
//Trace should yield 31
trace(LastDayOfMonth);
Date 객체를 년, 월 만 넣고 날짜는 0을 넣고 생성하면 그 객체의 day 속성은 마지막 날짜가 된다. ㅎㅎ
출처 : http://molaro.wordpress.com/2008/02/07/actionscript-determing-the-number-of-days-in-a-month/