Reputation: 190
By default the dijit.calendar shows the current date / month. Using the visual controls a user can change the view and choose a date. I need to problematically change the displayed date based on other circumstances.
Upvotes: 1
Views: 2617
Reputation: 3388
For anyone else who wants to change the "Displayed Date" and not the "Selected Date" of the calendar, you want the currentFocus
of the calendar. That is, the selected value
could be Jan 1, 2012, but the calendar is currently displaying December.
Try
// display the month of December 2012
widget.set('currentFocus', Date(2012, 11, 24))
Upvotes: 0
Reputation: 69934
You can set
the value
property, similarly to other widgets
//change the calendar's date to just now:
myCalendar.set('value', new Date() )
//change the calendar's date to Christmas eve
myCalendar.set('value', new Date(2012, 11, 24) )
Upvotes: 5