Export to GitHub

fullcalendar - issue #686

Do not display Sunday


Posted on Oct 25, 2010 by Happy Horse

Hello All:

Not sure if anyone else would benefit from this feature request: there is already a "weekend" mode, however, it would be great if there could be a mode to NOT show Sunday. So calendar would be m,t,w,th,f,s only. I am using this calendar to show some service scheduling and a lot of companies do not work on Sunday but do work on Saturday -- trying to give back a few pixels. ;-)

Great work on this project!

Thanks!

Comment #1

Posted on Nov 22, 2010 by Helpful Monkey

(No comment was entered for this change.)

Comment #2

Posted on Dec 23, 2010 by Quick Cat

I also would like to see this feature in Fullcalendar!

Comment #3

Posted on Jan 19, 2011 by Swift Wombat

I also be interested in the feature !!

Comment #4

Posted on Jan 20, 2011 by Swift Wombat

For those who are interested in this feature, waiting for the official update of the code, I give you the modifications I done in order to show/hide only sunday with 'weekends' parameter (based on fullcalendar-1.4.10) :

  • line 1213 (method render(date, delta)) : CHANGE renderBasic(1, weekends ? 7 : 5, false); BY renderBasic(1, weekends ? 7 : 6, false);

  • line 1897 (method render(date, delta)) : CHANGE renderAgenda(weekends ? 7 : 5); BY renderAgenda(weekends ? 7 : 6);

  • line 4266 (method skipWeekend(date, inc, excl)) : CHANGE while (!date.getDay() || (excl && date.getDay()==1 || !excl && date.getDay()==6)) { BY while (!date.getDay()) {

=> Only tested in agenda week view.

Comment #5

Posted on Mar 15, 2011 by Massive Ox

Comment deleted

Comment #6

Posted on Mar 15, 2011 by Massive Ox

An issue am facing here regarding the week view is that the width of an event in the allDaySlot on Saturday is not set properly. The width will be 0px based on calculations. Have been trying to go through the code as to where this could be fixed. Will look some further as to how I can get around this.

If anyone has an idea or solution, that would be great.

Comment #7

Posted on Mar 16, 2011 by Massive Ox

Okay, I found a 'solution'. If someone could verify this, since I am not sure whether this is the right way of doing it.

Basically in the function daySegHTML(segs) { on line 3607 there is the following: cols[0] = dayOfWeekCol(seg.start.getDay()); ols[1] = dayOfWeekCol(seg.end.getDay()-1);

Whenever it is saturday it returned cols[0] as 5 and cols[1] as 4, hence the 0px, because the result will be a negative width.

Adding the following 3 lines in the else would fix this: if (cols[1] < cols[0]) { cols[1] = cols[0]; }

In the if (rtl) { you would need to add:

if (cols[0] < cols[1]) { cols[0] = cols[1]; }

Comment #8

Posted on Apr 4, 2011 by Grumpy Panda

Comment deleted

Comment #9

Posted on Apr 4, 2011 by Happy Elephant

This would be nice to have :S sadly is marked as "Maybe"

Comment #10

Posted on Apr 28, 2011 by Swift Elephant

Hi,

I implemented it in my fork, see http://github.com/phurni/fullcalendar/tree/weekends. It is in its own branch, I'll send a pull request so that it may be merged.

Note that you may even choose which days are weekend days, so Sunday may be a working day and Saturday may be free.

Regards.

Comment #11

Posted on May 4, 2011 by Happy Bird

This feature will nice. Can specify all days who are OFF days. Not necessarily "Saturday" and "Sunday", for exemple "Wednesday","Sunday" and "Monday"

Waiting official implementation of this feature, i will try the new fullcalendar fork by phurni ...

Comment #12

Posted on Mar 6, 2012 by Happy Lion

@hurnip

Nice work - thanks for sharing.

Comment #13

Posted on Oct 3, 2012 by Happy Dog

A workaround for v1.5.4. At line 2757 change to the following: renderAgenda(weekends ? 6 : 5);

If you want, you can create a new configuration variable to have 7, 6 or 5 days.

Comment #14

Posted on Dec 17, 2012 by Swift Elephant

@sjac...@gmail.com, I too having the same requirement. Is there any other way to do this. Help me!!

Comment #15

Posted on Jan 23, 2013 by Happy Hippo

@juanjose

Thks for that tip, works wonderfully

Comment #16

Posted on Jul 18, 2013 by Helpful Monkey

this functionality is officially released with the hiddenDays option in version 1.6.2: http://arshaw.com/fullcalendar/docs/display/hiddenDays/

Comment #17

Posted on Jul 18, 2013 by Helpful Monkey

(No comment was entered for this change.)

Comment #18

Posted on Jul 18, 2013 by Happy Bird

Thank you arshaw for this new version 1.6.2 solving this issue with new "hiddenDays option"

Status: Done

Labels:
Type-Enhancement