5 Replies Latest reply on Feb 18, 2011 6:15 PM by jfb00

    mx:DateFormatter - Seemingly same string, one won't return formatted string


      Right now I am trying to read in data from a different XML file than I previously was reading from. The old one is called through the ArrayCollection shown here:

      var temp:ArrayCollection = _model.requirementTrend[this.project.id] as ArrayCollection;               
      var dataArray:Array = temp.source.slice(0, temp.source.length);


      The other one and the one I am trying to get to work now is myXML, and XML() object I'm converting the children of into an XMLListCollection, and then from an XMLListCollection into an Array.


      var xmlListCollection: XMLListCollection= new XMLListCollection(_model.myXML.children());
      var dataArray:Array = xmlListCollection.toArray();


      Both of these arrays are followed by the same code:


      data = new ArrayCollection(dataArray);
      var last:Object = data.getItemAt(data.length - 1);
      //var dateString:String = String(last.date) // <--Don't wanna convert each element
                                                  //    of my XML file into a string before
                                                  //    formatting it
      var formatDate1:String = dateAndTime2.format(dateString);

      last.date returned the same exact string:

      2011-02-18 09:22:11.000



      trace(formatDate1) returned the formatted date for the first dataArray (from temp), but it didn't return anything for the second dataArray (from xmlListCollection). Any ideas?