| Page 1 of 1 | [ 4 posts ] |
|
Hi,
I'm trying to accomplish the following. With an minDate in September and maxDate in April, I want the months arrows to toggle to disabled when each month is reached. I tried using the prevMonthClick and nextMonthClick, but they seem to be designated for something else. Any ideas? thx so much. |
Allen RabinovichYUI Developer
|
Hi Andrew,
That feature is not implemented yet (but is definitely on the radar, along with a slew of other options for calendar controls); the easiest thing to do would be to listen to the date change event in calendar, and when it hits either the minimumDate or maximumDate, to add a class to either the previous month or next month control that would change its appearance and disable hover behavior. You can then remove that class from either arrow when the date you hit is not either maximumDate or minimumDate). Helpful methods: Y.one("yui3-calendarnav-nextmonth") and Y.one("yui3-calendarnav-prevmonth") will get you the nodes corresponding to the control arrows; Y.one("...").addClass and removeClass will add and remove CSS classes for the nodes; and Y.DataType.Date.areEqual(date1, date2) can compare two dates (although you can just compare the month and the year). |
Allen RabinovichYUI Developer
|
The event from calendar that you want is 'dateChange', and it will have newVal and prevVal in the event payload -- newVal is the latest value displayed by the calendar. Keep in mind that for a multipane calendar, when the calendar hits maximumDate, this value will actually be (number-of-panes-1) smaller than the maximumDate (since maximumDate controls the highest month displayed, and 'date' always corresponds to the leftmost month displayed).
|
|
Yup, thanks, exactly what I was looking for.
I love the quick responses here! |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group