2
我使用的日曆從http://w3widgets.com/responsive-calendar/。 我想在onMonthChange上獲取事件的日期。 但是,年,月和日總是未定義的。responsive-calendar:獲取事件onMonth的日期更改
該插件的文檔做得很好,但沒有解釋如何通過示例做到這一點。
這裏是我的事件:
onMonthChange: function(events) {
var $year=$(this).data('year'); //here I get undefined
var $month=$(this).data('month');//here I get undefined
var $day=1; //but I´d like to get the day of the current date after changed
},
如果我使用的文檔這一事件很管用:
onDayClick: function(events) {
var thisDayEvent, key;
key = $(this).data('year')+'-'+addLeadingZero($(this).data('month'))+'-'+addLeadingZero($(this).data('day'));
}
您是否找到解決此問題的解決方案? – Polo