简体   繁体   中英

Flex 4 Dates, Bug or what? im so confused

I'm not sure whether it's a bug or what. But it's making my life worse.

I'm doing a Flex 4 application that has a calendar component in an invisible 'state' when I pass comp2.selectedDate(2006,2); and debug at line 3, date has only 2006 year and 0 month.

Why so? Why isn't it getting month = 2 as well?

Thanks in advance

public function selectedDate(year:Number, month:Number, day:* = null):void{
var date:Date = new Date(year, month, day);
dateChooser.selectedDate = date;
}

Wow, everything looks in order here. The only possible issue I see is passing in null for the day when creating a new Date. The default is 1, you may want to try setting the day to 1 when you detect null being passed into your method for the day. Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM