Short and efficient, thanks a lot Robert for sharing the best practices in Flex coding !
Pierre.
Pierre,
Here is another way:
import spark.formatters.DateTimeFormatter; var dateFormatter:DateTimeFormatter = new DateTimeFormatter(); var dateOn:Date = new Date(data.datereservon); dateFormatter.dateTimePattern = "DD/MM/YYYY"; dfData.text = dateFormatter.format(dateOn);
Hello,
Here's the way I'm dealing the date format returned in esriFieldTypeDate type in an ItemRenderer :
data.datereservon = the value in esriFieldTypeDate from the FeatureLayer
dfData = Datefield in ItemRenderer.
It's certainly not the most elegant way of coding it but it gives complete control on the final "look" of your date.
Hope it helps ...
Can you show more of your code? I have a similar issue from an attribute query. The Graphic(s) contained in the returned FeatureSet contain attributes of esriFieldTypeDate but it's not displaying in any known date format. If your code above works, how are you detecting that the attribute is of the date format?
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.