Max
Max

Reputation: 325

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;
}

Upvotes: 0

Views: 393

Answers (1)

Wade Mueller
Wade Mueller

Reputation: 6059

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.

Upvotes: 2

Related Questions