ravi.konaparthi

Time extent data not displayed for single day

Discussion created by ravi.konaparthi on Apr 23, 2010
Latest reply on Jun 10, 2012 by townofsnowflake
Hi,

I am working on application which requires TimeExtent feature. I created a timeextent and a timeslider and for the timeslider i created timestops as type esritimeunitsdays. The problem is when the right and left thumb of the timeslider are same i.e. records of a single day the map doesn't show the features on the map. This is because my startTime and endTime are same so the map is not getting the data for the day. Is there any workaround for this issue.

I am adding the code of the same:

var timeExtent = new esri.TimeExtent();
    var todayDate = new Date();
    timeExtent.startTime = new Date((todayDate.getMonth() + 2) + "/" + 1 + "/" + (todayDate.getFullYear() - 1) + " UTC");
    timeExtent.endTime = new Date((todayDate.getMonth() + 1) + "/" + GetLastDay() + "/" + todayDate.getFullYear() + " UTC");
    featureLayer.setTimeDefinition(timeExtent);

var timeSlider = new esri.dijit.TimeSlider({}, dojo.byId("monthslider"));
    map.setTimeSlider(timeSlider);
    timeSlider.setThumbCount(2);
    timeSlider.createTimeStopsByTimeInterval(timeExtent, 1, 'esriTimeUnitsDays');
    timeSlider.setThumbIndexes([300, 365]);
    timeSlider.startup();

Regards,
Ravi.

Outcomes