<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Datagrid Formatting in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192151#M4491</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a custom built application and it contains a datagrid that has a dataprovider of a Query and several different fields are returned. One of the fields in the datagrid is a date field and they are all coming from SDE and Arc10. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What should be a date of: 2/18/2011 is displaying down in the grid as: 1297987200000. If i have the value of the date going to a label instead of to the datagrid i get 2/18/2011. I believe it is converting the date to milliseconds or something but i'm not sure how to go about formatting the column in the datagrid to display the date in the datagrid as 2/18/2011.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried experimenting with the &amp;lt;MX:dateformatter&amp;gt; but haven't had any success is converting the column. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anybody else ran into this problem, or have suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Feb 2011 22:34:17 GMT</pubDate>
    <dc:creator>JasonNielsen</dc:creator>
    <dc:date>2011-02-23T22:34:17Z</dc:date>
    <item>
      <title>Datagrid Formatting</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192151#M4491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a custom built application and it contains a datagrid that has a dataprovider of a Query and several different fields are returned. One of the fields in the datagrid is a date field and they are all coming from SDE and Arc10. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What should be a date of: 2/18/2011 is displaying down in the grid as: 1297987200000. If i have the value of the date going to a label instead of to the datagrid i get 2/18/2011. I believe it is converting the date to milliseconds or something but i'm not sure how to go about formatting the column in the datagrid to display the date in the datagrid as 2/18/2011.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried experimenting with the &amp;lt;MX:dateformatter&amp;gt; but haven't had any success is converting the column. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anybody else ran into this problem, or have suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 22:34:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192151#M4491</guid>
      <dc:creator>JasonNielsen</dc:creator>
      <dc:date>2011-02-23T22:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Datagrid Formatting</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192152#M4492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try using a labelFunction:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/dataGridClasses/DataGridColumn.html#labelFunction"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/dataGridClasses/DataGridColumn.html#labelFunction&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 23:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192152#M4492</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2011-02-23T23:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Datagrid Formatting</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192153#M4493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jason,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Here is an example of what Dasa is talking about. I do this in my Enhanced Search Widget so I had the label function already done.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp; private function getDateLbl(item:Object,column:DataGridColumn):String
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var dateMS:Number = Number(item[column.dataField]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; var retVal:String = "";
&amp;nbsp;&amp;nbsp;&amp;nbsp; var rVal:String = item[column.dataField];
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(rVal == null)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!isNaN(dateMS))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retVal = msToDate(dateMS, "MM/DD/YYYY");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return retVal;
&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp; private function msToDate(ms:Number, dateFormat:String):String
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var date:Date = new Date(ms);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (date.milliseconds == 999) // workaround for REST bug
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date.milliseconds++;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dateFormat)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dateFormatter.formatString = dateFormat;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var result:String = dateFormatter.format(date);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (result)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return result;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return dateFormatter.error;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return date.toLocaleString();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:39:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192153#M4493</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T09:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Datagrid Formatting</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192154#M4494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you very much for the help Robert, and Dasa. I was able to get pass this datagrid issue and i can now concentrate on the rest of the application. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 01:37:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/datagrid-formatting/m-p/192154#M4494</guid>
      <dc:creator>JasonNielsen</dc:creator>
      <dc:date>2011-02-24T01:37:23Z</dc:date>
    </item>
  </channel>
</rss>

