Here is the code…

                        var j:int = 0;
                        for (i=minNum;i<length;i++)  {   
                                oColumnDef = new AdvancedDataGridColumn();
                                oColumnDef.headerText = 
MonthDisplay(modelLocator.aryMonths.getItemAt(i).begDate);

                                oColumnDef.dataField = "s"+[j+1];
                                oColumnDef.width = 100;
                                oColumnDef.labelFunction=dgCurFormat12
                                oColumnDef.setStyle("textAlign","right")
                                colArray.push(oColumnDef);
                                j=j+1;
                        }


                        private function MonthDisplay(item:String):String{      
        
                                var df:DateFormatter = new DateFormatter()
                                df.formatString="MMM-YYYY";
                                return df.format(item);                 
                        }       

aryMonths contains dates like these ('07/01/2013', '06/01/2013', '05/01/2013', 
'04/01/2013', '03/01/2013', etc)

The header text ends up showing Jan-2013,  Jan-2013,  Jan-2013,  Jan-2013,  
Jan-2013 etc)

It seems that the DateFormatter is reading the date in reverse order 
Day-Month-Year when applying the format…Versus Month-Day-Year…Is there a way to 
resolve this without rewriting all my database scripts to reformat dates?

William Page III
tel: (510) 589-0100
email: wp...@dashboardonline.com




Reply via email to