Fullcalendar,使今天当月的活动按钮 [英] Fullcalendar, Make Today Button for current month active

查看:1166
本文介绍了Fullcalendar,使今天当月的活动按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今日按钮当前月份已停用。当你去下一个月或上个月时,它显示为活动(当点击TODAY按钮控制转到当前月份)。

Today button disable for current month. when you go next or previous month it appear as active(when click on the TODAY button control goes to current month).

在下面的代码中我展示了如何使今天

In following code I am showing how to make today button active for current month.

 function makeTodaybtnActive()
      {
         $('#calendar button.fc-today-button').removeAttr('disabled');
         $('#calendar button.fc-today-button').removeClass('fc-state-disabled');
       }

(其中#calendar是fullcalendar id)

call日历加载时此函数

(where #calendar is fullcalendar id)
call this function when calendar load

 $(window).load(function() {
    makeTodaybtnActive();
 });

还在 eventRender strong> function

Also in eventRender function

   $('#calendar').fullCalendar({
        eventRender: function(event, element) {
          makeTodaybtnActive();
        },
   });

当日历加载(页面加载)时间第一个代码工作,当更改月份并转到当前

When calendar load (page load) that time first code work and when change the month and goes to current month (by clicking today button) then second code make Today button active.

推荐答案

今天按钮禁用当前月份(通过点击今天按钮)。当你去下一个月或上个月时,它显示为活动(当点击TODAY按钮控制转到当前月份)。

Today button disable for current month. when you go next or previous month it appear as active(when click on the TODAY button control goes to current month).

在下面的代码中我展示了如何使今天

In following code I am showing how to make today button active for current month.

 function makeTodaybtnActive()
      {
         $('#calendar button.fc-today-button').removeAttr('disabled');
         $('#calendar button.fc-today-button').removeClass('fc-state-disabled');
       }

(其中#calendar是fullcalendar id)

call日历加载时此函数

(where #calendar is fullcalendar id)
call this function when calendar load

 $(window).load(function() {
    makeTodaybtnActive();
 });

还在 eventRender strong> function

Also in eventRender function

   $('#calendar').fullCalendar({
        eventRender: function(event, element) {
          makeTodaybtnActive();
        },
   });

当日历加载(页面加载)时间第一个代码工作,当更改月份并转到当前月(通过点击今天按钮),然后第二个代码使今天按钮激活。

When calendar load (page load) that time first code work and when change the month and goes to current month (by clicking today button) then second code make Today button active.

这篇关于Fullcalendar,使今天当月的活动按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆