Calendar 响应日历:获取事件更改的日期

Calendar 响应日历:获取事件更改的日期,calendar,responsive,Calendar,Responsive,我使用的日历来自。 我想知道变更的日期。 但是年、月、日总是不确定的 插件的文档做得很好,但没有通过示例说明如何实现 以下是我的活动: onMonthChange: function(events) { var $year=$(this).data('year'); //here I get undefined var $month=$(this).data('month');//here I get undefined var $day

我使用的日历来自。 我想知道变更的日期。 但是年、月、日总是不确定的

插件的文档做得很好,但没有通过示例说明如何实现

以下是我的活动:

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') );
      }

您显示的文档适用于当日事件

使用
onMonthChange
时,没有事件参数,要访问对象,请使用
$(this)[0]
。您可以通过属性
currentmount
currentwear
访问新选择的月份(请参见代码):

$(“.responsive calendar”).responsiveCalendar({onMonthChange:function()){
警报(($(此)[0].currentMonth+1)+'/'+$(此)[0].currentYear);

} });你找到这个问题的解决方案了吗?