flex如何获取到当前月份的最后一天

 
<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="defaultYm()"> 
 
<mx:Script> 
 <![CDATA[
 	import mx.controls.Alert; 
  import mx.states.SetStyle; 
  import flash.sampler.NewObjectSample; 
  
  private function  defaultYm():void{ 
     var nowDate:Date = new Date();
     var nowyear:String = nowDate.getFullYear().toString();
     var nowmonth:String = (nowDate.getMonth()+1).toString().length == 1?"0"+(nowDate.getMonth()+1).toString():(nowDate.getMonth()+1).toString();
   
     var lastdaysOfMonth:String = daysOfMonth(nowyear+nowmonth);  
     Alert.show("当月最后一天"+lastdaysOfMonth);
  } 
  
   function daysOfMonth(Month):String{   
	   var currentMonth=new Date(Month.substring(0,4),Month.substring(4,6),1);   
	   var lastMonth=new Date(Month.substring(0,6)-1,1);   
	   var diffDays=currentMonth-lastMonth;     
	   return ""+(diffDays/( 24 * 60 * 60 * 1000));   
}   
 ]]> 
</mx:Script> 
  
</mx:Application> 

相关文章

一:display:flex布局display:flex是一种布局方式。它即可以...
1. flex设置元素垂直居中对齐在之前的一篇文章中记载过如何...
移动端开发知识点pc端软件和移动端apppc端软件是什么,有哪些...
最近挺忙的,准备考试,还有其他的事,没时间研究东西,快周...
display:flex;把容器设置为弹性盒模型(设置为弹性盒模型之后...
我在网页上运行了一个Flex应用程序,我想使用Command←组合键...