View Full Version : Configure initial dates (month) shown in DateField (DatePicker)?

17 Nov 2010, 2:51 PM
Problem in short: How do I set which month (date) is initially displayed when the DateField is expanded--how do I set it to a date other than today?

My application includes multiple DateField instances for picking a date corresponding to a water quality measurement. When the instruments are out of the water for the winter months there are no data available and, consequently, it can be months before new data are available.

Instead of showing the current month (of the current day), I'd like the DateField to display a given month (given date), i.e. the last date on which data were available (impact on users is significant--they have to hunt for days when data are available).

It would be nice if there was a configuration for this in the object literal. My weak attempt around this at the moment is to use DateField.setValue(), setting the value of the DateField to the given date (i.e. last date of data). This exploits the fact that the DateField opens to the month (date) of the current value:

thermistorChartDateSelect.setValue(datesArray[datesArray.length - 1]);

(Here, datesArray is the array of available dates).

I've searched the existing threads for any insight. Any advice is appreciated!