Saturday, April 08, 2006

Lack of Support for ISO 8601 Dates in Flex

It appears that Flex2 Beta2's Date.parse() doesn't accept date strings in ISO 8601 format. For example, Date.parse('2004-03-03') doesn't work. Since all databases understand date literals in ISO 8601, dates are commonly in that format when they're serialized as strings. This is particularly problematic in Flex2 Beta2 since Date.parse() is the method that's called by default by the charting component mx.charts.DateTimeAxis. If anyone knows whether this will be addressed before GA I'd be interested to know.


dave said...

Graeme did you get a fix for this? I've got the same problem (albeit from a Ruby on Rails backend).

Graeme Harker said...

Nope, still the same in Beta 3.

There is the DateFormatter class' parseDateString() method (see p999 of Beta 3's Developing Flex Applications book). It's just inconvenient that the chart components don't use this by default. I logged this feature as a bug in Beta2. The more people report it as a bug I guess the more chance of getting this fixed.