Created
March 30, 2016 17:17
-
-
Save raykendo/571faeee879d8959ed0f07bc56531e83 to your computer and use it in GitHub Desktop.
Quick and Dirty show Date from feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(["esri/map", "esri/layers/FeatureLayer", "esri/tasks/query"], function (map, FeatureLayer, query) { | |
var features = [/* assume a list of feature graphics will be assigned here soon */]; | |
// do stuff to assign maps, feature layers, etc. | |
// do stuff to assign features as a list of search results from a feature layer | |
var importantDates = features.map(function (feature) { | |
if (feature.attributes["ImportantDate"] !== null) { | |
return new Date(feature.attributes["ImportantDate"]); | |
} | |
}); | |
var importantDatesAsStrings = importantDates.map(function (dateObj) { | |
return [ | |
dateObj.getUTCMonth().toString(), | |
dateObj.getUTCDate().toString(), | |
dateObj.getUTCFullYear().toString() | |
].join("/"); | |
}); | |
// do something with the important dates as string. | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment