Search This Blog

Monday, September 27, 2010

Flex4 DateField bug when using locale nl_NL

When porting a Flex 3 application to Flex 4 (4.1 SDK), I had a little issue with my DateField components. The selected date in the DateField component did not have any formatting applied to it and when accessing the selectedData property in Actionscript returned null. For example selecting 7th September 2010 resulted in '0709092010' but it should be '07/09/2010'.

Some searching revealed that this is a known bug which is hopefully resolved in SDK4.5. See http://forums.adobe.com/message/2834803 for more details.

A quick workaround is to specify the formatString explicitly in the DateField component as in the following example:
<mx:DateField id="date" formatString="DD/MM/YYYY"/>
<s:Button click="trace(date.selectedDate);"/>

No comments: