1 Reply Latest reply on Dec 23, 2006 10:39 AM by See4th

    Date Format

    See4th
      How would you format the date of a remote object cfc result when the date field coming back is being assigned to a datagrid field with the dataProvider?

      I tried this and the compiler does not recognize "Version_Date". However if I put just dataField="Version_Date", it has no problem.

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

      <mx:DataGridColumn headerText="Date"
      dataField="{myDateFormat.format(Version_Date)}" />

      Thanks,

      Jeff
        • 1. Re: Date Format
          See4th Level 1
          I ended up adding a new field to the dataProvider ArrayCollection when the event is handled:

          public function handleVersionsResult(event:ResultEvent):void{
          versionsResult=event.result as ArrayCollection;
          // add a formatted date field to the ArrayCollection
          for (var i:int = 0; i<versionsResult.length; i++){
          versionsResult .versionDate_formatted = StandardDateFormat.format(versionsResult.Version_Date);
          }
          }

          Then set the datagrid column's dataField to the newly created formatted date field:

          <mx:DataGridColumn headerText="Date"
          dataField="versionDate_formatted" />