Select to view content in your preferred language

FV 3.0 date and number formatting will not work in my popups

3149
8
09-21-2012 05:28 AM
C_EHoward
Frequent Contributor
I want to format my date fields to display correctly and I cannot seem to get the settings to work in my Flex 3.0 app.

Popups- I want to not show the comma (thousand seaprator)
I have tried both 'useThousandsSeparator" and "useThousandSeparator" with the value ="false" yet the commas presist. Snytax looks like this

<field name="YEAR" alias="Year opened:" visible="true"> 
<format dateformat="year" useThousandSeparator="false"/>
</field>

I have also been unsuccessful in getting the 'shortdateshorttime" date format to work, my dates show up as numbers such as 125046000 or something like that.

I looked at the 3.0 API reference and the date formats and the useThousandsSeparator are listed as options. Is there something additional that needs to be set, or is this a bug? Having number fields displayed isnt very useful if they do not look correct. thanks for any suggestions.

Charlene
Tags (2)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
Charlene,

   All attributes in any of the XML configuration file must be lower case. Even though the Flex API documentation has useThousandSeparator in the popup.xml it needs to be usethousandseparator. Is your YEAR field a true esri date field?
0 Kudos
C_EHoward
Frequent Contributor
I dont think the year field actually, its listed as a short integer in the GDB- this is a GDB I inherited so I didnt think to look at altering the field types. I will check into that. I did switch all to lower case and it still did not work, so I will look at field type next.

as an aside, does the format and usethousandseparator work withyour eSearch widget? I do have a date field in my related table I am using to query/display and export, but what should be shortdateshorttime is not looking good.

thanks for the help!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Charlene,

   You will find the supported field formatters in the documentation for the eSearch. But formatters will only work if the original field is the correct type for the formatter.
0 Kudos
C_EHoward
Frequent Contributor
Thanks Robert. Based on your documentaion, I got the date field to read with MM/DD/YYY as the format. The data in my date field is MM/DD/YYYY hh:mm:ss tt. I did not see any example of how to view that format- is it psossible? I tried to locate an Esri example for dateformat as the document suggests, but I could not find a format that worked. Ideally I want to show date and time such as MM/DD/YYYY HH:MM:SS and AM or PM. thanks for any suggestions
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Charlene,

  Here is what you need.

MM/dd/yy h:mm:ss a This is case sensitive!!!

Documentation here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/formatters/DateTimeFormatte...
0 Kudos
C_EHoward
Frequent Contributor
Just getting back to this now......thanks Robert.

I included this in my config file and it only displays the date part correctly, records look like this
08/25/2009 h:mm:ss a. But, I did have to change the day and year to capital letters however, as when I kept it as-is the date displayed 08/dd/yy h:mm:ss a

I think I need to more closely look at the field format in my tables. I thought the format you provided would work since in  my data, the field displays
8/25/2009 1:00:00 AM. going to keep trying!
0 Kudos
C_EHoward
Frequent Contributor
Just getting back to this now.....thanks for the response.

The format did not work for me however. I got a date looking like 08/dd/yy h:mm:ss a. I changed to caps for the date and that part looked good with 08/25/2012 h:mm:ss a. All caps for everything yielded an 'invalid format'

I used this format <field name="StarTime" dateformat="MM/DD/YY L:NN:QQ A" /> and it looks good! seems like there are way too many ways to possibly format dates, and trial and error will get you what you need.

This link in the Esri files helped me figure it out
http://help.arcgis.com/en/webapps/flexviewer/help/index.html#//01m30000000t000000

Hope this helps some others

Charlene



Charlene,

  Here is what you need.

MM/dd/yy h:mm:ss a This is case sensitive!!!

Documentation here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/formatters/DateTimeFormatte...
0 Kudos
BjornSvensson
Esri Regular Contributor
This link in the Esri files helped me figure it out
http://help.arcgis.com/en/webapps/flexviewer/help/index.html#//01m30000000t000000
Hope this helps some others


FYI - The 3.0 version of that doc is at http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Pop_up_configuration_files/01m3...

Also, just a minor note about
...documentation has useThousandSeparator in the popup.xml it needs to be usethousandseparator.


Since 2.3, there is an extra "s" in that tag - "usethousandsseparator" - which better syncs with the API (except for the casing which is always camelCase in the API, but all lowercase in the viewer configuration files.
0 Kudos