I am configuring the .xml code for the Search widget to work for my web app. I need help formatting a Date field. Inside the web app, it displays with the following format: Day Month Date Year HH:MM:SS AM/PM (see snapshot below). Essentially, I just want the short date format as shown: MM/DD/YYYY. I do not need the time. I have tried the code shown below, but it does not truncate the date:
<field name="INSTALLDATE" alias="Install Date"/>
<format precision="-1" usethousandsseparator="false" useutc="false" dateformat="M/D/YYYY"/>
</field>
Any ideas what I need to change/add to get the format I want?
Solved! Go to Solution.
Alexander -
If you are using the default Search Widget in Flex the data field can be displayed as:
dateformat—Format in which the date is displayed. Default is a full date and time in the user's locale using date.toLocaleString(). Example date formats include YYYYMMDD, MMMM, YYYY, J:NN:SS, EEEE, MMM. D, YYYY at L:NN:QQQ A. See DateFormatter documentation for a full description.
I would suggest trying MM/DD/YYYY to see if that works. Also, here is the documentation for the Search Widget - that may end up being helpful as well.
Alexander -
If you are using the default Search Widget in Flex the data field can be displayed as:
dateformat—Format in which the date is displayed. Default is a full date and time in the user's locale using date.toLocaleString(). Example date formats include YYYYMMDD, MMMM, YYYY, J:NN:SS, EEEE, MMM. D, YYYY at L:NN:QQQ A. See DateFormatter documentation for a full description.
I would suggest trying MM/DD/YYYY to see if that works. Also, here is the documentation for the Search Widget - that may end up being helpful as well.
I needed to remove some of the unnecessary code, but once this was done, the "dateformat" tag worked with the formatting exactly as you described. Thanks.