The differences between Query and Identify is the expected behavior. The Identify (and Find) operations always return results as formatted text - even numeric values are returned as strings. You can workaround this by creating a new date based on the date string then format that value. For example,feature.attributes.created_date = new Date(result.feature.attributes.created_date); var template = new esri.InfoTemplate("Attributes", "${created_date:DateFormat(datePattern:'MMMM d, yyyy.',selector:'date')}");
feature.attributes.created_date = new Date(result.feature.attributes.created_date); var template = new esri.InfoTemplate("Attributes", "${created_date:DateFormat(datePattern:'MMMM d, yyyy.',selector:'date')}");
var dt = new Date("06/08/2012 16:25:45"); alert(dt.toUTCString());
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.