| Issue 166: | Option to hide day numbers/events/cells for prev/next months | |
| 21 people starred this issue and may be notified of changes. | Back to list |
For example, October 2009 starts on a Thursday so you also see September 27 thru 30 at the beginning of the calendar. Is there any way to turn this off so those cells would simply be blank?
Nov 18, 2009
#1
Andrei.C...@gmail.com
Nov 20, 2009
I added this:
if (view.name == 'month' && (event.start.getUTCMonth() != view.start.getUTCMonth())) {
eventElement.addClass('ui-helper-hidden');
}
before this:
triggerRes = view.trigger('eventRender', event, event, eventElement);
Then in my stylesheet, I added this:
td.fc-other-month .fc-day-number {
visibility: hidden;
}
Of course, you'd change .addClass('ui-helper-hidden') to whatever it is you want to
use to hide the events.
Nov 26, 2009
hi all, sort of going off of what snh9905 said, but with a simpler solution...
i'd add the following CSS (make sure it is after fullcalendar.css):
td.fc-other-month .fc-day-number {
display: none;
}
I'd also set the 'weekMode' option to either 'liquid' or 'variable' to avoid having
entire rows of blank days.
i'm closing this issue, but please respond if you have any more questions/problems.
thanks
Status:
Done
Jan 18, 2010
and how to disable the event on this disabled days of other months? here it is still showing the event that should only show in the next month thanks
Jan 19, 2010
ah yes, i understand. the events will still be displayed on those days, even though the number is not there. this calls for a new option. not sure when i'll get to it, but i understand the need for it now. thanks
Summary:
Option to hide day numbers/events for prev/next months
Status: Accepted Labels: -Type-Defect Type-Enhancement
Jan 20, 2010
edyd.junges - in the meantime, you can use the code I posted above to hide the actual
events...
if (view.name == 'month' && (event.start.getUTCMonth() != view.start.getUTCMonth())) {
eventElement.addClass('ui-helper-hidden');
}
Jan 21, 2010
thsnks but does not work, throws error on internet explorer
Aug 25, 2010
Issue 603 has been merged into this issue.
Sep 19, 2010
Does anyone have a working solution for this issue? I would really like to implement this but it doesn't seem to work
Feb 13, 2011
snh9905's code didn't work for me- close- but I think some things have changed in the source code since he posted it.
Around line 3618 find where it's applying the classes:
--
className = 'fc-event fc-event-hori ';
--
replace that with:
---
//what month the event is
var theEventMonth = event.start.getUTCMonth();
//what month we're viewing
var showingMonth = t.start.getMonth();
if(theEventMonth != showingMonth){
className = 'hiddenEvent ';
}else{
className = 'fc-event fc-event-hori ';
}
---
In my css I have:
.hiddenEvent{display: none;}
//keep the shape of the boxes we're hiding
.fc-other-month{visibility: hidden}
There may be a more practical place to implement this so you don't waste time rendering the Events. But it works for what I needed to do.
Jan 10, 2012
//what month the event is
var theEventMonth = event.start.getUTCMonth();
//what month we're viewing
var showingMonth = t.start.getMonth();
if(theEventMonth != showingMonth){
className = 'hiddenEvent ';
}else{
className = 'fc-event fc-event-hori ';
}
Tried this solution it works the only thing is that it will not work for event set on 1st day of the month.. weird.. :(
Jan 31, 2012
@hpodev : I am using FullCalendar v1.5.2 and here is the lines in fullcalendar.js
#4593 function daySegHTML(segs) { // also sets seg.lefte and seg.outerWidth
.
.
.
#4614 classes = ['fc-event', 'fc-event-skin', 'fc-event-hori'];
if (isEventDraggable(event)) {
classes.push('fc-event-draggable');
}
now tell me where do i paste the codes you have suggested??
Aug 13, 2013
(No comment was entered for this change.)
Labels:
-Type-Enhancement -Priority-Medium Type-Feature
Aug 13, 2013
Issue 949 has been merged into this issue.
Aug 24, 2013
Issue 1802 has been merged into this issue.
Aug 24, 2013
Issue 1869 has been merged into this issue.
Aug 7, 2014
description modified to include the possibility of not event displaying the cell's box at all.
Summary:
Option to hide day numbers/events/cells for prev/next months
(was: Option to hide day numbers/events for prev/next months)
Aug 7, 2014
Issue 2223 has been merged into this issue.
Aug 21, 2015
Discussion for this issue has moved to the following URL: https://github.com/fullcalendar/fullcalendar/issues/437 This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event. Happy coding, Adam
Status:
ExportedToGithub
|
|
| ► Sign in to add a comment |