有可能在一个月后的全日历中隐藏之前的日子。js插件

时间:2022-02-02 18:07:56

I'm using arshaw.com fullcalendar jQuery plugin. By default it shows the current month days, but it also shows some days before and after (of the previous and next month) to fill the full grid from sunday to saturday.

我使用的是arshaw.com fullcalendar jQuery插件。默认情况下,它显示的是当前的月份,但它也显示了在(之前和下个月)之前和之后的一些日子,从周日到周六填充整个网格。

Is there a way to hide this extra days, so the calendar month view shows only the current month days and leave empty the other spaces, or at least a way to hide and event that is registered on a different month, not in the actual one.

是否有一种方法可以隐藏这额外的天数,所以日历月视图只显示当前月份的天数,并清空其他空间,或者至少是一种隐藏和事件的方法,它是在一个不同的月份注册的,而不是在实际的月份。

2 个解决方案

#1


2  

In your event generator, skip events not in current month. Then add

在事件生成器中,跳过当前月份的事件。然后添加

.fc-other-month .fc-day-number {display:none;}

#2


0  

Try this. It will hide the dates but not the events of past and upcoming events of other months:

试试这个。它将隐藏日期,而不是过去的事件和其他月份的事件:

.fc-day-number.fc-other-month {
    opacity: 0;
    filter: alpha(opacity=0); /* for IE */
}

#1


2  

In your event generator, skip events not in current month. Then add

在事件生成器中,跳过当前月份的事件。然后添加

.fc-other-month .fc-day-number {display:none;}

#2


0  

Try this. It will hide the dates but not the events of past and upcoming events of other months:

试试这个。它将隐藏日期,而不是过去的事件和其他月份的事件:

.fc-day-number.fc-other-month {
    opacity: 0;
    filter: alpha(opacity=0); /* for IE */
}