Select to view content in your preferred language

Date Showing Incorrectly in Pop-Up Window

1674
7
06-20-2011 08:03 AM
StuartBlumberg
Emerging Contributor
I have a feature class in a file geodatabase of crime incidents in the city.  I would like to show the date, among other things, in a pop-up window.  However, when I click on an incident or do a search on incidents, the date in the pop-up window is always the previous day (for example, if I click on an incident that occured 4/3/2011 the pop-up window will read 4/2/2011.  If I click on multiple incidents all the dates are of the previous day.  I am using the 2.3.1 API with Server 10.  I am using Robert's Enhanced Search Widget however I have tried it using the out-of-the-box search widget with the same result.  It seems to only be happening in the pop-up-window.  I've tried creating new feature classes with different date formats however I get the same result.  Anybody else having this issue?  Thanks.
Tags (2)
0 Kudos
7 Replies
PatrickWard1
Deactivated User
Stuart,

What version of the Flex Viewer are you using and which Pop-up widget are you using?

Flex Viewer 2.1, 2.2, 2.3, 2.3.1?

Simple Info Window Widget, Info Popup Widget, Standard pop-up windoes (new in version 2.3 of the API).
0 Kudos
StuartBlumberg
Emerging Contributor
I am using the Flexviewer 2.3.1 with Server 10.   I am using Robert's Enhanced Search Widget however I have tried it using the out-of-the-box search widget with the same result.
0 Kudos
PatrickWard1
Deactivated User
I am using the Flexviewer 2.3.1 with Server 10.   I am using Robert's Enhanced Search Widget however I have tried it using the out-of-the-box search widget with the same result.


I haven't seen this in Flex Viewer 2.3.1. Can you post your out of the box SearchWidget.xml code?
0 Kudos
StuartBlumberg
Emerging Contributor
  <layer>
   <name>April Calls for Suspicious Persons</name>
   <url>http://dpgis01/ArcGIS/rest/services/Incidents_April2011/MapServer/0</url>
   <expression alias="DATE" textsearchlabel="Search Citations by Date" field="Call_Time" usedomain="true">Call_Time = date '[value]'</expression> 
   <expression alias="NATURE" textsearchlabel="Search Citations by Date" field="Nature" usedomain="true"></expression> 
   <expression alias="ADDRESS" textsearchlabel="Search Citations by Date" field="Street" usedomain="true"></expression> 
   <textsearchlabel>Search by Address or HCAD Number</textsearchlabel>
   <graphicalsearchlabel>Use one of the graphical search tools to identify parcels</graphicalsearchlabel>
   <fields all="false">
               <field name="Call_Time" alias="DATE" dateformat="MM/DD/YYYY" gridfield="true"/>
               <field name="Nature" alias="NATURE" gridfield="true"/>
               <field name="Street" alias="ADDRESS" gridfield="true"/>
             </fields>
   <titlefield>Nature</titlefield>
   <linkfield></linkfield>
   <!-- <webfield>HCAD_Link</webfield> -->
   <gridfields>Call_Time,Nature,Street</gridfields>
     

  </layer>


Thanks
0 Kudos
StuartBlumberg
Emerging Contributor
I cheated, I converted the field to a 'String'
It works now....
0 Kudos
PatrickWard1
Deactivated User
Stuart,

There is a documented bug for Flex Viewer 2.1 and the InfoPopupWidget logged as NIM061858: (The date is displayed in a different format from what is entered, in the InfoPopupWidget in Flex Viewer 2.1). The documentation states that the date field is displayed in the popup window as one day less than the actual date. Please contact Esri Support Services to see if the behavior you are experiencing with the search widget in Flex Viewer 2.3.1 could be related and if so logged with your company�??s information for documentation purposes.
0 Kudos
HNoakes
Esri Contributor
Recently encountered this problem as well in the Flex Viewer 2.4. We have been provided with a resolution from ESRI;


Here is the solution for the Date display issue. Esri REST API assumes that the date value is in �??coordinated universal time�?� (UTC) so when the client displays it in local time, it offsets for the time zone so it appears to be the previous day.

In Flexviewer version 2.4, there is an attribute called useutc for the DateFormat property, which can be used to set the display date appropriately.

For example, you can have a Date field defined in the Popup_x.xml configuration file:
<field name="OccDate" visible="true">
             <format dateformat="shortDate" useutc="true"/>
</field>

You can see the API documentation at:
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/webmap/supportClasses/PopUpFieldFormat.htm...
0 Kudos