This content has been marked as final. Show 5 replies
if you are using a datefield to display the string you can use the formatString property and set it to the desired format e.g formatString="DD/MM/YYYY"
hope that helps
Of course I am using formatString.( for example "DD/MM/YYYY")
My problem is that data "Jan-21-2008" is being processed correct and "21-Jan-2008" is not.
And i can't find any normal tutorial or explanation about possible types of data for DataFormatter. :-(
when you say process, what exactly are you trying to do with dates. Are you trying to just display them as you mentioned or doing something else with it?
Yes. only to show.
Code is very simple:
private var datef:DateFormatter = new DateFormatter();
var f:String = datef.format(value);
when value is "Jan-11-2008" f gets correctly formatted string,when value is "11-Jan-2008" i get "Invalid value" error.
try the format functions specified in this link : http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=controls_059_14.html
I tried formatting the datefield property to dd//mm/yyyy format and it displayed it fine. I noticed that your have dd-mmm-yyyy, the mmm is to get the month's name, are sure you can pass the format with a hyphen rather than a backslash ie dd-mmm-yyyy or should it be dd/mmm/yyyy? I was displaying the month by its integer so it was working fine.
Try the function in the link above and see if it helps.