Has anyone else noticed the new formatter property failing to format
dates correctly when called from inside an AdvancedDataGridColumn?  It
gets the year totally wrong.  The formatted date comes out looking like
"10/17/700" when it should be "10/17/2007".  

 

The column passes the date as a string ("Thu Oct 18 17:23:27 GMT-0700
2007"), but when DateFormatter runs the string through
DateFormatter.parseDateString, it figures the timezone offset is the
year, and ignores the year.  Strange, eh?

 

 

Here's some example code, simple as I could make it:

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical">

 

      <mx:DateFormatter id="snafuDateFormatter"
formatString="MM/DD/YYYY" />

 

      <mx:AdvancedDataGrid dataProvider="{[{testDate:new Date}]}"
width="100%" height="100%">

             <mx:columns>

               <mx:AdvancedDataGridColumn dataField="testDate"
headerText="Original Date"/>

               <mx:AdvancedDataGridColumn dataField="testDate"
headerText="Formatted Date" formatter="{snafuDateFormatter}"/>

             </mx:columns>

      </mx:AdvancedDataGrid>

      

</mx:Application>

 

 

Has anyone else wrestled with this yet?  

Is it a real Flex bug?  A known one?

Am I maybe just on crack instead?

 

Any help is very much appreciated...

 

- - - - - - - - - - - - - - - - - - - -
Trevor Peace
Admios
880 Harrison St. Suite 201
San Francisco, CA 94107

(415) 762-0736 x115
www.admios.com 

Reply via email to