I am using the jquery ui datepicker in my app. I have created an inline datepicker. I am having a problem with onChangeMonthYear. I have simplified the example to bare minimum.
Onclick of "prev" or "next", the calendar should: -
- Go to the previous/next month accordingly.
- Set the first day of that month as the current selected date.
- alert that date
The problem is with #2.
I am using setDate to do that, and it is ending up in infinite recursion. Because, I am calling setDate inside onChangeMonthYear. And setDate is also firing onChangeMonthYear internally.
How can I achieve those 3 things when prev/next is clicked.