<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Query using TimeExtent and a date picker in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-using-timeextent-and-a-date-picker/m-p/150773#M14051</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have brought in a date picker using datetimepicker.js. I want to query a feature layer by the date brought in using the date picker. Even though I have chosen the date using the date picker, the information coming into the grid is still for a different date than the one I chose. If someone could help me accomplish this, I would appreciate it. For now, it is the last item that I need to accomplish the viewer that I am trying to build. The entire code for the project is on jsfiddle here:&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://jsfiddle.net/mrogers83/Hz59f/5/" rel="nofollow" target="_blank"&gt;http://jsfiddle.net/mrogers83/Hz59f/5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The specific area that I am looking at is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function execute(){&amp;nbsp; var queryTask = new QueryTask(window.historicalUrl);&amp;nbsp; var query = new Query();&amp;nbsp; query.text = dom.byId("mydropdown").value;&amp;nbsp; query.timeExtent = new TimeExtent(dom.byId("date").value);&amp;nbsp; query.returnGeometry = true;&amp;nbsp; query.outFields = window.historicalOutFields;&amp;nbsp; queryTask.execute(query, function (results) { &amp;nbsp; var data = []; &amp;nbsp; var data = array.map(results.features, function (feature) { &amp;nbsp;&amp;nbsp; return { &amp;nbsp;&amp;nbsp;&amp;nbsp; "Vehicleid": feature.attributes[window.historicalOutFields[0]], &amp;nbsp;&amp;nbsp;&amp;nbsp; "Velocity": feature.attributes[window.historicalOutFields[1]], &amp;nbsp;&amp;nbsp;&amp;nbsp; "StreetName": feature.attributes[window.historicalOutFields[4]], &amp;nbsp;&amp;nbsp;&amp;nbsp; "TimeStamp": feature.attributes[window.historicalOutFields[3]] &amp;nbsp;&amp;nbsp; } &amp;nbsp; }); &amp;nbsp; var memStore = new Memory ({data:data}); &amp;nbsp; window.grid3.set("store", memStore);&amp;nbsp; }); };&amp;nbsp; &amp;lt;div id="rightPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'right'"&amp;gt;&amp;nbsp; Unit ID:&amp;nbsp; &amp;lt;select id = "mydropdown"&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277793"&amp;gt;PD080&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277794"&amp;gt;PD168&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277783"&amp;gt;PD169&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277773"&amp;gt;PD170&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-3983647"&amp;gt;PD171&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277790"&amp;gt;PD172&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277795"&amp;gt;PD878&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277772"&amp;gt;PD879&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277785"&amp;gt;PD880&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277788"&amp;gt;PD881&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277791"&amp;gt;PD882&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277798"&amp;gt;PD884&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277775"&amp;gt;PD977&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277789"&amp;gt;PD978&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277776"&amp;gt;PD979&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277778"&amp;gt;PD980&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277780"&amp;gt;PD981&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277787"&amp;gt;PD3018&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2939847"&amp;gt;PD3019&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277786"&amp;gt;PD3020&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277781"&amp;gt;PD3021&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277802"&amp;gt;PD3022&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;/select&amp;gt;&amp;nbsp; Date: &amp;lt;input id="date" type="text" size="18"&amp;gt;&amp;lt;a href="javascript:NewCal('date', 'mmddyyyy')"&amp;gt;&amp;lt;img src="images/cal.gif" width:"16" height="16" border="0"&amp;gt;&amp;lt;/a&amp;gt;&amp;nbsp; &amp;lt;div&amp;gt;&amp;nbsp; &amp;lt;input id ="execute" type="button" value="Get Details"&amp;gt;&amp;nbsp; &amp;lt;input id ="mapshow" type="button" value="Show on Map"&amp;gt;&amp;nbsp; &amp;lt;input id ="clear" type="button" value="Clear History"&amp;gt;&amp;nbsp; &amp;lt;/div&amp;gt;&amp;nbsp; &amp;lt;div id="grid3"&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;/div&amp;gt; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again, any help is greatly appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Michelle&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#B22222&amp;quot;;"&gt;Edit: I figured out what my issue was. We did not have time enabled on the service, therefore I could not query the time extent. We enabled the time on the service and changed the query to: &lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt;query.timeExtent = new TimeExtent(new Date(dom.byId("date").value));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Mar 2014 13:28:32 GMT</pubDate>
    <dc:creator>MichelleRogers1</dc:creator>
    <dc:date>2014-03-11T13:28:32Z</dc:date>
    <item>
      <title>Query using TimeExtent and a date picker</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-using-timeextent-and-a-date-picker/m-p/150773#M14051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have brought in a date picker using datetimepicker.js. I want to query a feature layer by the date brought in using the date picker. Even though I have chosen the date using the date picker, the information coming into the grid is still for a different date than the one I chose. If someone could help me accomplish this, I would appreciate it. For now, it is the last item that I need to accomplish the viewer that I am trying to build. The entire code for the project is on jsfiddle here:&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://jsfiddle.net/mrogers83/Hz59f/5/" rel="nofollow" target="_blank"&gt;http://jsfiddle.net/mrogers83/Hz59f/5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The specific area that I am looking at is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;function execute(){&amp;nbsp; var queryTask = new QueryTask(window.historicalUrl);&amp;nbsp; var query = new Query();&amp;nbsp; query.text = dom.byId("mydropdown").value;&amp;nbsp; query.timeExtent = new TimeExtent(dom.byId("date").value);&amp;nbsp; query.returnGeometry = true;&amp;nbsp; query.outFields = window.historicalOutFields;&amp;nbsp; queryTask.execute(query, function (results) { &amp;nbsp; var data = []; &amp;nbsp; var data = array.map(results.features, function (feature) { &amp;nbsp;&amp;nbsp; return { &amp;nbsp;&amp;nbsp;&amp;nbsp; "Vehicleid": feature.attributes[window.historicalOutFields[0]], &amp;nbsp;&amp;nbsp;&amp;nbsp; "Velocity": feature.attributes[window.historicalOutFields[1]], &amp;nbsp;&amp;nbsp;&amp;nbsp; "StreetName": feature.attributes[window.historicalOutFields[4]], &amp;nbsp;&amp;nbsp;&amp;nbsp; "TimeStamp": feature.attributes[window.historicalOutFields[3]] &amp;nbsp;&amp;nbsp; } &amp;nbsp; }); &amp;nbsp; var memStore = new Memory ({data:data}); &amp;nbsp; window.grid3.set("store", memStore);&amp;nbsp; }); };&amp;nbsp; &amp;lt;div id="rightPane" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'right'"&amp;gt;&amp;nbsp; Unit ID:&amp;nbsp; &amp;lt;select id = "mydropdown"&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277793"&amp;gt;PD080&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277794"&amp;gt;PD168&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277783"&amp;gt;PD169&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277773"&amp;gt;PD170&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-3983647"&amp;gt;PD171&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277790"&amp;gt;PD172&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277795"&amp;gt;PD878&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277772"&amp;gt;PD879&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277785"&amp;gt;PD880&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277788"&amp;gt;PD881&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277791"&amp;gt;PD882&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277798"&amp;gt;PD884&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277775"&amp;gt;PD977&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277789"&amp;gt;PD978&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277776"&amp;gt;PD979&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277778"&amp;gt;PD980&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277780"&amp;gt;PD981&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277787"&amp;gt;PD3018&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2939847"&amp;gt;PD3019&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277786"&amp;gt;PD3020&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277781"&amp;gt;PD3021&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;option value = "239-2277802"&amp;gt;PD3022&amp;lt;/option&amp;gt;&amp;nbsp; &amp;lt;/select&amp;gt;&amp;nbsp; Date: &amp;lt;input id="date" type="text" size="18"&amp;gt;&amp;lt;a href="javascript:NewCal('date', 'mmddyyyy')"&amp;gt;&amp;lt;img src="images/cal.gif" width:"16" height="16" border="0"&amp;gt;&amp;lt;/a&amp;gt;&amp;nbsp; &amp;lt;div&amp;gt;&amp;nbsp; &amp;lt;input id ="execute" type="button" value="Get Details"&amp;gt;&amp;nbsp; &amp;lt;input id ="mapshow" type="button" value="Show on Map"&amp;gt;&amp;nbsp; &amp;lt;input id ="clear" type="button" value="Clear History"&amp;gt;&amp;nbsp; &amp;lt;/div&amp;gt;&amp;nbsp; &amp;lt;div id="grid3"&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;/div&amp;gt; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again, any help is greatly appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Michelle&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color:&amp;quot;#B22222&amp;quot;;"&gt;Edit: I figured out what my issue was. We did not have time enabled on the service, therefore I could not query the time extent. We enabled the time on the service and changed the query to: &lt;SPAN style="color:&amp;quot;#0000FF&amp;quot;;"&gt;query.timeExtent = new TimeExtent(new Date(dom.byId("date").value));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 13:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-using-timeextent-and-a-date-picker/m-p/150773#M14051</guid>
      <dc:creator>MichelleRogers1</dc:creator>
      <dc:date>2014-03-11T13:28:32Z</dc:date>
    </item>
  </channel>
</rss>

