Hi all,
I was wondering if anyone knows how to format the date in the "daterange" of the Time Slider. I want it to state:
Month Year". My input data was formatted using YYYYMM. Currently, I just get years.
Thanks for all your help!
Solved! Go to Solution.
NM Water,
I use the dojo/date/locale module. That allows you to format the date the way you would like. here is an example:
//add labels for every other time stop var labels = arrayUtil.map(timeSlider.timeStops, function(timeStop, i) { if (i % 2 === 0) { return locale.format(timeStop, { datePattern: 'MMYY', selector: 'date' }); } else { return ""; } });
Regards,
Tom
NM Water,
I use the dojo/date/locale module. That allows you to format the date the way you would like. here is an example:
//add labels for every other time stop var labels = arrayUtil.map(timeSlider.timeStops, function(timeStop, i) { if (i % 2 === 0) { return locale.format(timeStop, { datePattern: 'MMYY', selector: 'date' }); } else { return ""; } });
Regards,
Tom
Thanks Tom! This fixed the issue.
However, I have another one now:
My date range in my rest services indicate:
However on my slider the first date being displayed is December of 1983 and the last date is November 2013. it's shifting the time intervals by one month. Have you ever encountered this before?
Best,
Francisco
Francisco,
I have not seen that problem before. I see that you are expressly setting your timeExtent too. Which version of the the JSAPI are you using?
Regards,
Tom