My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
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
Status:  ExportedToGithub
Owner:  ----
Closed:  Aug 2015


Sign in to add a comment
 
Reported by snh9...@gmail.com, Nov 4, 2009
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
did you found a solution for this problem?
Nov 20, 2009
#2 snh9...@gmail.com
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
Project Member #3 adamrs...@gmail.com
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
#4 edyd.jun...@gmail.com
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
Project Member #5 adamrs...@gmail.com
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
#6 snh9...@gmail.com
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
#7 edyd.jun...@gmail.com
thsnks but does not work, throws error on internet explorer
Aug 25, 2010
Project Member #8 adamrs...@gmail.com
 Issue 603  has been merged into this issue.
Sep 19, 2010
#10 s006...@gmail.com
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
#11 jrockwel...@gtempaccount.com
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.


Screen shot 2011-02-13 at 10.39.22 PM.png
36.6 KB   View   Download
Jan 10, 2012
#12 hpodev.m...@gmail.com
//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
#14 xkeshav
@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
Project Member #15 adamrs...@gmail.com
(No comment was entered for this change.)
Labels: -Type-Enhancement -Priority-Medium Type-Feature
Aug 13, 2013
Project Member #16 adamrs...@gmail.com
 Issue 949  has been merged into this issue.
Aug 24, 2013
Project Member #17 adamrs...@gmail.com
 Issue 1802  has been merged into this issue.
Aug 24, 2013
Project Member #18 adamrs...@gmail.com
 Issue 1869  has been merged into this issue.
Aug 7, 2014
Project Member #19 adamrs...@gmail.com
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
Project Member #20 adamrs...@gmail.com
 Issue 2223  has been merged into this issue.
Aug 21, 2015
Project Member #21 adamrs...@gmail.com
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

Powered by Google Project Hosting