AnsweredAssumed Answered

Labelling date field on a featurelayer

Question asked by mturnbullesriaustralia-com-au-esridist Employee on Nov 15, 2015
Latest reply on Nov 15, 2015 by oearley

Hi Javascript Gurus

 

I am having difficulty labelling (client side) a featurelayer with a date field. I have tried turning the map object's showLabels to true and tried creating a LabelLayer and adding it to the map, both options produce the same results. If I specify just the date field, I get labels that are the raw date object (number of seconds since  1/11970). I have tried to use the {DATE:DateString} and {DATE:DateFormat} functions but they present empty labels. I have also tried to re-set the labelClass on the feature layer to use FORMATDATETIME(DATE,"d/M/yyyy") but still the labels are empty. I would prefer not to have to create a field that contains a formatted date string in the map service. Is there anyway to debug why the labels are not appearing as expected (I have checked the ArcGIS Server logs and the browser console but cant find any errors relating to the labelling)? What is the right approach to labelling dates on a feature layer?

 

Thanks

Outcomes