2
votes

I' m trying to use the DateField control. I can set the current value using the selectedDate field.

Adobe says: "Selecting the currently selected date in the control deselects it, sets the selectedDate property to null", so when user selects other date the selectedDate = null. How do I can get the current selected value? I only saw in the debugger that DateField's text property contains the string with selected date? Do I need to parse it back?

10x in advance yevgeny

3

3 Answers

5
votes

I think I found the problem. I was trying to format the date like.

but I only implemented the label function and not the parse function and this caused the problem. When I implemented both everything became okay

1
votes

Found the solution here.

Simply set the parseFunc property of DateField as null. Did the trick for me..!!

1
votes

You can do:

<mx:DateField selectedDate="{new Date()}"/>

this will give you today's date as selected date or you can do:

<mx:DateField selectedDate="{new Date(2010, 5, 7)}"/>

This will select the date 7th of June 2010

Month inputted is always -1 of the month you write: so december is 11, january is 0 and so on