mediawiki-extensions / mw-calendar

Automatically exported from code.google.com/p/mw-calendar
0 stars 2 forks source link

5dayweek view for entire month #97

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi 
First of all, Great work :) 

I'm starting to use it and I'd like to be able to display a month without
saturdays and sundays. i.e a 5-days view for the whole month.
I'm trying to write a little modification, so that it will be possible to
choose to display a month without weekends.
I've been able to eliminate days from the displayed month, but I'm having
troubles removing headers
I took a (very brief) look at the code and I think that by adding an 

if($this->setting('5daymonth',true){
 $numberOfDaysToDysplay = 5;
} 
if($j<$numberOfDaysToDisplay){
$ret .= $this->getHTMLForDay($this->month, $dayOffset, $this->year);
} else {}
 at line 807 should do the trick, together with a new 
<!-- Day Heading Start -->
<!-- Day Heading End -->
with [[day6]] and [[day7]] removed

Of course it would be very nice to bind this to a configuration directive
like for example 5daymonth

Thanks in advance for your interest.
Should you need/want help, drop me a line :)
motosauro@gmail.com

Original issue reported on code.google.com by motosa...@gmail.com on 20 Aug 2009 at 4:06

GoogleCodeExporter commented 8 years ago
The whole 5dayweek(weekmode) is a kludge and needs a good overhaul. Its all 
hacked
off the original code. The calendar template would have to be modified with the 
table
<colspan> also. Basically, the main template is hardcoded to expect 7 columns.

Original comment by kenyu73 on 20 Aug 2009 at 6:11

GoogleCodeExporter commented 8 years ago
I concurr
Actually it's not that bad since there are not so much variables. Adding just a
template would not be that bad in my opinion.
My proposal is:
I rewrite the template just adding the 5days month version (copy+paste)
I add the configuration directive 5daymonth
I add the logic to handle it
And then i pass all the modifications to you for reviewing.
Would that be ok?
All in all should be less than 50 LOC

I would like to have this feature implemented, but I'm not too keen on 
diverging from
your code.

Tell me what you think :)

Original comment by motosa...@gmail.com on 21 Aug 2009 at 6:54

GoogleCodeExporter commented 8 years ago
I made the modifications:
You can diff the attached files to see the changes (just a few lines) and see 
if they
are acceptable.
Just one note, In the case of 5daymonth I forced monday to true, since I presume
nobody would want to see a 5 days week that spans from saturday to wednsday. It
seemed to me a more efficient way of handling the issue.

Original comment by motosa...@gmail.com on 24 Aug 2009 at 7:46

Attachments:

GoogleCodeExporter commented 8 years ago
I am using MW 1.15.1 with your calendar extension version 3.8.  I am trying to 
make 
the 5dayweek work.  I have tried with the original source and with the two 
files 
above.  Neither seem to make the 5dayweek work.  Here is my calendar config:

<calendar name="Tom's Schedule" 5dayweek monday usetemplates enablerepeatevents 
/>

It's a brand new calendar but I just can't make it work with a 5dayweek, all 7 
are 
still displayed.  Any suggestions?

Original comment by nnieh...@gmail.com on 15 Sep 2009 at 2:26

GoogleCodeExporter commented 8 years ago
PLease note two things:
5dayweek works only for the display of a single week.
My modifications are just a suggestion up till now, use them at your own risk :)
Nevertheless the 5dayweek clause should work when displaying a single week, 
while the
5daymonth clause (the one added by me) should work when displaying a full month

Original comment by motosa...@gmail.com on 15 Sep 2009 at 4:44

GoogleCodeExporter commented 8 years ago
Hi Motosauro

Thanks for all the suggestions, I really appreciate it!

I've updated the trunk branch with a bunch of changes with 5day views. I 
basically
overhauled the logic. I'm still activially working on it today, but your 
welcome to
d/l and review/comment on what I have already.

* I havent hit the "week" mode yet and I havent updated the year heading either.

* "5dayweek" mode now activates "monday" mode as well

Original comment by kenyu73 on 15 Sep 2009 at 5:09

GoogleCodeExporter commented 8 years ago
Thanks to you ;)
In my company we are starting to use your Calendar and the modification + my
5daymonth customization.
I'll be glad to help you in developement.
As soon as I'll have some time left I'll download a snapshot.

Original comment by motosa...@gmail.com on 15 Sep 2009 at 6:58

GoogleCodeExporter commented 8 years ago
Nniehoff, 

As Motosauro stated, the currently released version only support 5dayweek in 
"week"
mode. I'm currently testing v3.8.4 with 5dayweek using month and year view.

It's actually testing well and I may release it today.

Thanks
Eric

Original comment by kenyu73 on 15 Sep 2009 at 7:07

GoogleCodeExporter commented 8 years ago
v3.8.4

Original comment by kenyu73 on 15 Sep 2009 at 11:42

GoogleCodeExporter commented 8 years ago
thx :)

Original comment by motosa...@gmail.com on 17 Sep 2009 at 7:05