Tags:
create new tag
view all tags

Archives of Calendar Plugin Development Discussions

This topic contains older content moved over from CalendarPluginDev

-- PeterThoeny - 10 May 2003

  • Adds a %CALENDAR% tag that shows a monthly calendar (current month).
  • Highlights days corresponding to Events or to Recurring Events

Download it from TWikiPluginAPI and give it a try...

-- AndreaSterbini - 27 Jan 2001

TODO

  • when including the topic, filter event list to show only events falling in the chosen month
  • move defaults to preferences?
  • add a parameter to use CalendarMonthSimple instead than the heavier CalendarMonth (see below)

-- AndreaSterbini - 27 Feb 2001

Nice Plugin, however problem with netscape - the alt text doesn't seem to work at all... (Using Linux Netscape version 4.73) As a result you get a nice calendar, but no indication of what's going on... :-/

-- MichaelSparks - 13 Mar 2001

me too .... (version 4.76) ... here it works ....

PS ... the plugin wants european dates .... is it this the problem?

-- AndreaSterbini - 14 Mar 2001

[ It turns out it's a Netscape limitation. If you have tool tips turned off in your preferences, you don't get the alt text, and if you have the tool tips enabled, you do get the alt text pop up. MichaelSparks - 24 Mar 2001
]

I have tried to make a three month calender, using three %CALENDAR% items in one page. There was an error in the HTML::ElementSuper.pm so I started to use three different pages with links.

A nice feature would be to configure a delta to the current month. Now it is only possible to set a special month or use the current month. How about a delta item to use it like this

  • %CALENDAR{delta="1"}% to show the next month
  • %CALENDAR{delta="-1"}% to show the last month

-- StefanScherer - 15 Mar 2001

The Calendar plugin is great. I like Stefan's delta idea (may be call the parameter offset=".." ? )

I suggest to change the date format to the ISO date format TWiki is using elsewhere. Also, it is better to find a syntax that does not have unwanted side effects. How about this:

  • 2 Feb: Andrea's birthday
  • 7 Mar: Nicoletta's birthday
  • 29 May 1996: Maria Teresa is born!
  • 29 Sep 1998: Davide is born!

or:

  • 2 Feb - Andrea's birthday
  • 7 Mar - Nicoletta's birthday
  • 29 May 1996 - Maria Teresa is born!
  • 29 Sep 1998 - Davide is born!

I installed it on a not so fast machine and found out the the plugin eats lots of resources.

  • Here are the real CPAN dependencies: HTML::AsSubs.pm, HTML::CalendarMonth.pm, HTML::Element.pm, HTML::ElementGlob.pm, HTML::ElementSuper.pm, HTML::ElementTable.pm, HTML::Tagset.pm

  • The execution time drops to almost half, also for topics that have no calendar.

Benchmarks:

  • Testing non existing topic, Calendar is ENABLED:
    • user: 1.25 (0.02), system: 0.13 (0.00)
  • Testing non existing topic, Calendar is DISABLED:
    • user: 0.76 (0.02), system: 0.08 (0.00)
  • Testing CalendarPlugin topic with a calendar, Calendar is ENABLED:
    • user: 1.82 (0.02), system: 0.13 (0.00)
  • Testing CalendarPlugin topic with a calendar, Calendar is DISABLED:
    • user: 0.84 (0.02), system: 0.04 (0.00)

I can't install it at work with this performance hit. Any chance to reduce the module dependencies and increase the performance?

  • May be a first step to do a lazy load of modules CalendarPlugin.pm needs, e.g. only if the text to be rendered contains a calendar tag.
  • Reduce or eliminate dependencies on HTML modules?

-- PeterThoeny - 22 Mar 2001

Thanks for pointing it out, I'll do Lazy use-eing ...

-- AndreaSterbini - 29 Mar 2001

Another calendar worth checking out: http://myphpcalendar.sourceforge.net/

-- PeterThoeny - 08 Apr 2001

While getting all the CPAN modules, I've seen also the HTML::CalendarMonthSimple module. I don't know how it looks like, but it has the same intend to reduce the CPAN dependencies.

http://search.cpan.org/search?dist=HTML-CalendarMonthSimple

-- StefanScherer - 12 Apr 2001

Thanks for the pointer, as soon I find time I will add it to the plugin (it's a rather nice package!!!).

-- AndreaSterbini - 09 May 2001

Updated to:

  • init returns 1 if correctly initted
  • use lazy load to lower the plugin memory footprint (see above)

-- AndreaSterbini - 10 Jun 2001

Thanks for the plugin, Andrea!

However, I've added two features I missed (see the attached CalendarPlugin.pm; my editing is marked "#cs#"):

  • allow for relative month/year attributes, e.g. month="+1" for the next month
  • highlight current day (using bgcolor as for calendar heading)

I've also fixed an entry to the httpd error log, which occured on every call of the plugin, due to a missing sub in one of the *.pm used.

-- ChristianSchultze - 25 Sep 2001

As StefanScherer pointed out, whenever I tried to make multi-month calendar in one page, HTML::ElementSuper.pm suffers from taint problem which I cannot understand. It seems occurs only after the first time handleCalendar subroutine called. The exact sentence that causes this error is

$c->item($c->year,$c->month)->wrap_content(font({size => '+2'}));

I tried wrap it up with eval[] and it worked, though not sure why the error occurs without eval[].

eval q[$c->item($c->year,$c->month)->wrap_content(font({size => '+2'}))];

Anyway, now I have multi-month calendar without separating the page into several pages. Hope I can have it without the eval[].

-- JikhanJung - 28 Nov 2001

Fixed a bug in the plugin's use of HTML::CalendarMonth: $c->item() must be used with day numbers without leading zeroes. For just the fix, replace the following in CalendarPlugin.pm (2 occurences!):

item($d  =>  item(0+$d

For the fix plus my modifications to the original plugin (see above), download the attached version of the *.pm.

The bug was encountered and reported to me (why me? wink ) by MatthiasWientapper.

-- ChristianSchultze - 04 Mar 2002

Great plugin! I am new to TWiki configuration...been using it for class and work since August 2001. Just installed on Windows 2000 using Opera browser...plugin works fine, thanks!

-- RobertRaygan - 06 Mar 2002

I've just uploaded version 1.003 of CalendarPlugin. It adds:

  • all ChristianSchultze very good improvements (thanks!)
  • uses HTML::CalendarMonthSimple by default else falls on HTML::CalendarMonth

TODO: parse ISO dates

  • I will probably change slightly the event syntax to:
   * *<date specification>* - Description
i.e. I will add "space minus space"

This would allow to make full use of the Date perl module for date parsing.

-- AndreaSterbini - 25 Mar 2002

How about adding

$cal->showweekdayheaders(1);
$cal->weekdayheadersbig(0);
or maybe making this a configuration option in =
February 2024
        01
First of the month
02
Andrea's birthday
03
04 05
Every Monday
Every Monday
06 07 08 09 10
11 12
Every Monday
Every Monday
13 14 15 16 17
18 19
Every Monday
Every Monday
20 21 22 23 24
25 26
Every Monday
Every Monday
27 28 29    

= ? Well, weekdaynames are rather big, but they are pretty usefull, too. Maybe there will be the option of abbreviated weekdaynames or even weeknumbers in upcoming versions of HTML::CalendarMonthSimple?
Furthermore I encountered some error-messages of this type in my apache error.log:

[Sun Mar 31 16:06:46 2002] null: Use of uninitialized value in numeric eq (==) at /usr/local/share/perl/5.6.1/HTML/CalendarMonthSimple.pm line 197.
(As I am not a perl wizzard - not yet - all I can do is mentioning errors and feature requests than solving/implementing them)

-- MatthiasWientapper - 31 Mar 2002

I am considering the idea of simplifying the plugin:

  • remove the HTML::CalendarMonth support and use only HTML::CalendarMonthSimple
  • move all default settings of the calendar to the CalendarPlugin topic
  • allow the usage of all settings as attributes of the %CALENDAR% tag
E.g.: %CALENDAR{showweekdayheaders="1"}%

Is there anybody against the removal of the heavy HTML::CalendarMonth dependence?

-- AndreaSterbini - 03 Apr 2002

Simplifying is always good, go for it! Also the * *<date specification>* - Description syntax sounds good so that it does not clash with other bullets in the topic.

-- PeterThoeny - 03 Apr 2002

I'd like the calendar to show the day names (as above), but also show the events inside the calendar table.

Also, have the performance issues reported by Peter been taken care of?

  • yes! [Main.AndreaSterbini]

-- ChrisRiley - 17 Apr 2002

I have just uploaded version 1.004

  • uses only HTML::CalendarMonthSimple
  • uses all HTML::CalendarMonthSimple (you can set almost all of its settings)
  • has ISO dates

-- AndreaSterbini - 05 May 2002

Found a bug in 1.004. Not sure if it's a typo or an Italian->English (missed) translation issue (I can't believe every month but July abbreviates the same way in Italian and English, so I can't believe this was intentional). The abbreviation for July was listed as "Lug" which mean that all July entries didn't work. I'm attaching diffs to fix it.

-- RobNapier - 18 May 2002

Thanks a LOT for the fix! I have just uploaded the updated version. (I am really ashamed for the stupid error embarrassment )

The correction on HTML::CalendarMonthSimple has been added to the last version (1.17), and it's coming to the CPAN nearest to you! smile

-- AndreaSterbini - 19 May

Got another little patch here. First part is just a small perl correction for (probably very slight) performance and simpler code with much less duplication. At the end of handleCalendar, change the map/grep combos this way:

@days = grep { s/^\s*\*\s+([0-9]?[0-9])\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+([12][0-9][0-9][0-9])\s+-\s+(.*)$/$1|$2|$3|$4 / ? $_ : '' }
                split( /\n/, $text);
and
@days = grep { s/^\s*\*\s+([0-9]?[0-9])\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+-\s+(.*)$/$1|$2|$3 / ? $_ : ''}
                split( /\n/, $text);

There's no reason for the extra map{}. grep{} can do all the magic for you just as easily with grep{s/.../ ? $_ : ''} since s// returns true if it fired.

The second piece of magic is the extra space I stuck at the end of the substitutions (after $4 and $3 above). This fixes a bug related to this kind of entry:

  • 21 Jun 2002 - Stuff to do

For some reason, this will render correctly in the list, but will render with the stars intact (not bolded) in the calendar table. If you add a space (or anything else) to the end of the list entry, it renders correctly in the table. Adding the space as part of the substitute makes it magically work, too (and ensures that it's always there). I don't understand this, so it may be worth investigating further, but the issue feels like its either somewhere in TWiki itself (versus your plugin), or some kind of interaction between HTML::CalendarMonthSimple's HTML and TWiki's "wiki inside of HTML" parser.

BTW, just for coding style, I recommend factoring out the common parts of the two massive regexes into a constant and using that instead of duplicating it. But then I have a real aversion to duplicated code.

-- RobNapier - 21 May 2002

It appears to me that the CalendarPlugin uses different defaults for settings inherited from HTML::CalendarMonthSimple. E.g., CalendarPlugin seems to use center as the default for cellalginment or vcellalignment, but the perl module uses left and top, respectively. Is that on purpose?

-- ThomasWeigert - 31 May 2002

The following would be two great enhancements to this wonderful plugin:

  • Allow the entering of date ranges, e.g., * 21 Jun 2002 - 23 Jun 2002 - Vacation
  • When entering a date range, optionally create entries for weekdays only.

-- ThomasWeigert - 31 May 2002

This is a nice plugin, and dates are now in the regular TWiki format smile

I did some new benchmarking at work with the plugin:

Topic Not installed Disabled Enabled
WelcomeGuest 2.64 2.68 2.68
TWikiRegistration 1.16 1.20 1.22
CalendarPlugin 1.38 1.43 1.60

There is no noticable performance hit anymore if there is no CALENDAR in the topic.

Small suggestion. Some of the generated code is not XHTML, look at the HTML source of a topic that has a CALENDAR. Would be nice if this gets fixed.

-- PeterThoeny - 08 Jun 2002

This is a really useful plugin, thanks everyone! Would there be any easy way of making some entry visible only to "registered users" (i.e. those logged in with a login name + passwd)?

-- MarkoNiinimaki - 09 Sep 2002

In my case, CalendarPlugin doesn't appear with %ACTIONSEARCH{....}% (ActionTrackerPlugin) in the same page

-- JungwooHa - 05 Oct 2002

%ACTIONSEARCH{....}% probably changes the path, and TWiki has a relative path to load Plugin modules. Plugins with a problem fail silently with the current production TWiki. The fix is to use an absolute lib search path. Read details in TroubleWithPlugins, SettingLibPath, TracePluginSyntaxErrors

-- PeterThoeny - 06 Oct 2002

Sorry, I feel like blind. Can please somebody point me to what I did wrong? I receive

Undefined subroutine &TWiki::Plugins::CalendarPlugin::handleCalendar 
called at ../lib/TWiki/Plugins/CalendarPlugin.pm line 107.
But handleCalendar is defined in this same file. So what?

-- NorbertGawor - 13 Nov 2002

  • I got the same message. My fault was: I didn't install the CPAN prerequisits. I had to install the following CPAN modules:
    • Bit::Vector
    • Date::Calc (needs Bit::Vector)
    • HTML::CalendarMonthSimple (needs Date::Calc)
  • Now the CalendarPlugin runs.
-- GuentherSchmid - 14 Nov 2002

  • After I installed all those modules, I still got same messages and I solved this problem by moving sub commonTagsHandler to the end of the CalendarPlugin.pm file before '1;' line. -- KyuwoongHwang - 04 Mar 2005

It would be nice to have the possibility of putting more than one calendar in one line (or row), using the | | | TextFormatingRule.

-- DiegoPamio - 11 Dec 2002

I've posted an updated version of the plugin to CalendarPlugin and attached my version of the module to this page. It adds the ability to put montly repeating items in. (Ex. third wednesday every month -> " * 3 Wed - Description")

-- DanBoitnott - 10 Dec 2002

Dan, thanks for your update, but I'm not able to say every 5. Monday. If this would be possible, I could use the monthly repeating as weekly repeating.

-- GuentherSchmid - 11 Dec 2002

I'm sorry about that. I found the problem, the regex that looks for the number is [1-4] instead of [1-5] like it should be. The line is close to the bottom of handleCalendar() (I think) and I'll fix it ASAP. Also, I'm not sure I understand what you meant about "weekly repeating." Are you looking for something that would do like "Every Monday" or something like that?

-- DanBoitnott - 11 Dec 2002

I've posted the fix. I changed $montly_rx to look for [1-6] just in case. I'd like to do another type of montly repeater that keys on date (ie. 1st of the month or 15th of the month) but haven't fixed on a syntax. My ideas are:

  • 1 - First of the month
  • 15 EMON - 15 of the month (EMON standing for "Every Month")
  • 6 Monthly - 6th of the month

I'm not really satisfied with any of these ideas but am leaning toward "6 Monthly." Thoughts? Also, any thoughts on a syntax for "Every Monday" sort of repeaters? I'm thinking:

  • Every Mon - Every Monday

-- DanBoitnott - 11 Dec 2002

How about this syntax for a weekly event:

  • E Mon - Every Monday

and this for a bi-weekly event:

  • EO Fri 06 Dec 2002 - Every other Friday starting 06 Dec 2002

-- DanBoitnott - 11 Dec 2002

I've posted another small fix to the module. Date::Calc uses 7 for Sunday and I had it down as 0. This will fix any problems someone might have were their Sunday items don't show up properly.

-- DanBoitnott - 11 Dec 2002

I've posted another version which includes weekly and bi-weekly syntax:

  • E Mon - Every Monday
  • EO Fri 06 Dec 2002 - Every other Friday starting 06 Dec 2002
While working on it I realized two things:
  1. The weekly and bi-weekly functionality would be better replaced with En where n is the number of days between events. Weekly would become E7, bi-weekly E14, daily E1, etc. I'll work this out soon. For this reason (and the one below) I did not post this update to the CalendarPlugin page.
  2. I was probably jumping the usual development cycle by posting a new version of the plugin to the CalendarPlugin page. If this is the case, I am very, very sorry and can only offer the excuse that I wasn't aware of the dev page until after I posted. This is also my fault for not reading the page fully before posting. Again, sorry for any trouble I've caused.
    • If I jumped the gun, what is the ussual cycle for formal releases?

-- DanBoitnott - 11 Dec 2002

I've posted a test version with the repeating syntax above. I dropped the bi-weekly option because you have to give a start date anyway for it to work. I retained the weekly syntax so you don't have to give a start date if you don't need one and the system won't wast time counting out from your start date. Here's the syntax for the two setups:

  Syntax Example
Weekly Event <3 spaces>* E DDD - description E Wed - Every Wednesday
Periodic Event <3 spaces>* En dd MMM yyyy - description E3 02 Dec 2002 - Every three days starting 02 Dec 2002

TODO:

  • Add start date support to Weekly events
  • Add end date support to Weekly and Periodic events
  • Add support for monthly events like "1st of the month" and "15th of the month." Suggestions on syntax?

-- DanBoitnott - 12 Dec 2002

Cant solve this error, please help

Undefined subroutine &TWiki::Plugins::CalendarPlugin::handleCalendar
called at ../lib/TWiki/Plugins/CalendarPlugin.pm line 107.

I followed instructions above and installed Bit-Vector and Date-Calc,
but what is install here. Should I follow INSTALL.txt in the
packages ?
I only copied the xxx.pm files into Twiki/plugins.
Is that enough, and if not what may be wrong ??
By the way, thanks for TWiki and the plugins!!
/Tore Agblad in Sweden
-- ToreAgblad - 16 dec 2002

You do need to follow the INSTALL.txt. You also need to install the rest of the package. Did you install the HTML::CalendarMonthSimple CPAN module? That's required for this plugin.

-- DanBoitnott - 17 Dec 2002

Yes I started with that one. But I have not followed INSTALL.txt. So back to work I guess. Thanks, Tore -- ToreAgblad - 17 dec 2002

I've posted my latest version. This one adds a few things including monthly items which occur on numbered days like 15th of each month. I'm not sure exactly what I've updated so here's the complete syntax as it is in the version I posted:

  Syntax Example
Normal Event <3 spaces>* dd MMM yyyy - description 09 Dec 2002 - Expo
Interval Event <3 spaces>* dd MMM yyyy - dd MMM yyyy - description 02 Feb 2002 - 04 Feb 2002 - Vacation
Yearly Event <3 spaces>* dd MMM - description 05 Jun - Every 5th of June
Monthly Event <3 spaces>* w DDD - description 1 Fri - Every 1st Friday of the month
Monthly Event <3 spaces>* dd - description 14 - The 14th of every month
Weekly Event <3 spaces>* E DDD - description E Wed - Every Wednesday
Periodic Event <3 spaces>* En dd MMM yyyy - description E3 02 Dec 2002 - Every three days starting 02 Dec 2002

I've been running this version for a while and done lots of testing on a few of my sites and it seems to work alright. I thought I'd put it out there and see what others think. If nobody objects, I'd like to post it to CalendarPlugin as a new version.

I'm still planning to add interval support to those that don't have them but haven't found the time.

-- DanBoitnott - 18 Dec 2002

Here's a new syntax I've come up with to allow exceptions in items which produce more than one highlight:

  • 03 Dec 2002 - 22 Dec 2002 X { 06 Dec 2002, 09 Dec 2002 - 12 Dec 2002 } - Description
I have a need for something like this because of one-time schedule changes to repeating events due to holidays etc. Thoughts?

-- DanBoitnott - 19 Dec 2002

I've posted a new version of the module with the exception support mentioned above. All item types support this feature except single dates with years (it would be a waste of time). The exception list is marked like this:

  • 03 Dec 2002 - 22 Dec 2002 X { 06 Dec 2002, 09 Dec 2002 - 12 Dec 2002 } - Description
The exception list is a comma delimited list of full dates and date ranges. As far a I can tell it works alright, but I haven't tested it much yet so be warned. Also, I need to go through some of the exception code and make it faster.

-- DanBoitnott - 20 Dec 2002

I've posted a new version of the module which improves the way the modules are loaded and used in the code I added. I wasn't taking full advantage of Perl's selective loading features.

-- DanBoitnott - 20 Dec 2002

I must have forgotten to "Save"... one possible enhancement would be the ability to define alternate day headings, which HTML:CalendarMonthSimple doesn't provide attributes for (i.e., it provides accessor methods instead).

-- AnthonPang - 25 Dec 2002

small suggestion: being able to read dates/periods from more than one topic could be useful.(having bank holidays in one topic, web specific dates in an others ...). An other + would to render this events differently depending on the topic the date read from. (specifying the rendering in the topic the dates are read from instead of the Plugin preference topic )

-- MarcelTrap - 27 Dec 2002

At the moment the only way read from multiple topics is to include them onto a single page with the INCLUDE tag. And then specify that master page as the topic for the CALENDAR tag. The include method will not work if the calendar is drawing from it's own page because it relies on tag expansion and this would create a circular reference. I don't know if this functionality is included in the main release on the CalendarPlugin page but it is in the dev release attached to this page. As far as different rendering for different source topics, it may be possible to do something clever with the format parameter but I'm not sure.

-- DanBoitnott - 27 Dec 2002

I just found the CalendarPlugin and would like to suggest the following features (not sure whether they are already in one ofthe Dev versions):

  1. The calendar should (optionally) show anniversaries when a full date is given:

Event Definition on 10 Feb 2000 on 10 Feb 2001
* 10 Feb 2000 - Pete Pete Pete [1]

  1. The calendar should allow event definition in several separate topics and merge these so that eg one can have one topic for national holidays, one for personal events etc and then can select which ones to include.
    • I too would really like this feature. -- MC.
  2. For that purpose there should maybe be an optional 'importance' of events to control in which sequence they are shown in one day's field if more than one apply (plus a max # events to show per day)
  3. There should be a 'redletter' option to make an event create a red-letter day.
  4. The calendar could look up user-specific variables (defined in a user's personal topic?) to decide which event topics to actually read or which sequence of importance to use? Not sure how this woudl exactly look, but it could allow a single calendar to be personalized by user reading it?

-- MathiasKoerber - 30 Dec 2002

I've just installed CalendarPlugin, and things are looking really promising here. I do have one question..... what I'm primarily interested in using it for is a sort of WikiLog.

Is there anyway (as the plugin currently stands, or through a simple hack - my perl is nearly non-existant, but I'm not afraid to break things and start over if someone can give me a push in the right direction) to have the calendar automatically link to daily topics, rather than listing events directly within the calendar itself.

What I mean is, having each date be automatically set as a WikiWord or link, which would lead to the topic (in this case, a blog entry) for that day (i.e. "13Feb2003", or a more appropriate date format)

-- StephanieSmith - 13 Feb 2003

I'd like to add a web-form to the Calendar page that would take a date and a description as parameters and on submit would do two things:

  1. create an entry in the current calendar
  2. create a new topic with a name based on a predefined template, topic name prefix (using hidden paramaters) and the entered date

I'd appreciate if authors would add such a feature or maybe let me know how I can do this myself. I know perl, but very little php and I am a novice in TWiki.

Thanks.

-- NicholasSushkin - 18 Mar 2003

If you view previous versions of a topic with the calendar entries defined in the same topic you still see the current callendar. This is probably just another manifestation of the preview bug.

-- SamHasler - 02 May 2003

It seems that automatically generated appointments (e.g. calculated dates) dont show up in the calendar. A (silly) example:

   * %GMTIME{"$day $month $year"}% - Today
   * %CALC{"$EVAL(%GMTIME{"$day"}% + 1)"}% %GMTIME{"$month $year"}% - Tomorrow
   %CALENDAR%

Nothing will show up in the calendar. We found out that a web's source file is used without beeing 'pre-compiled' by the TWiki layout mechanism. It would be great to have it.

-- JensKloecker - 07 May 2003

I host two sites on the same server in America. One site serves the UK and the other Australia. Presently both sites highlight the date that is current in America!

  1. Has anyone got a fix that will fudge the hightlighting to force it to a given single timezone?
  2. Has anyone any thoughts as to how to fix this generally problem generally so that a site that serves multiple timezones shows the appropriate setting according to a user preference?

-- MartinCleaver - 07 May 2003

It seems that the dev version of this plugin has been sitting around being tested for quite some time. I've added the patches provided by AnthonPang & JensKloecker, added a new yearly syntax, and posted it as V 1.008 to the release page. The new yearly syntax allows for events like "The 3rd Friday in June" and "The last Sunday in April." You can see this version of the plugin in action at http://www.lclinux.org/twiki/bin/view/Test/CalendarTest. I'm also looking at how to handle the timezone issue.

-- DanBoitnott - 07 May 2003

I just added a new attribute "lang" to the calendar to select the language for the month and day names. Example:

   %CALENDAR{ lang = "de" showweekdayheaders="1" }%

produces German language month and day headings. The attribute values are those of Date::Calc (see the module documentation). A patch is attached.

-- JensKloecker - 07 May 2003

After a few hours of frustration I discovered the problem with the timezone issue. I had coded in the ability to set the $currentDay variable using an offset from GMT but it wouldn't highlight the offset day on the calendar. It turns out that HTML::CalendarMonthSimple figures out the date on it's own and doesn't accept explicit values. There are three ways to fix this:

  1. Have the script temporarily set the date on the server and set it back when it's finished. - This would be silly in the extreme and would be forbidden by any decent OS.
  2. Patch HTML::CalendarMonthSimple to accept the new values, post the patch here, and try to get it accepted into CPAN
  3. Do away with the HTML::CalendarMonthSimple dependency by integrating the calendar rendering functionality into the plugin
Any thoughts? Also, would anybody mind the refactoring of this page? It's gotten really long and most of the issues have long since been addressed.

-- DanBoitnott - 08 May 2003

Just upgraded from v1.006 to v1.008 Plugin seems not working for Windows Twiki. (calendar page was working fine on v1.006 but not on v1.008)

This problem only exist on calendar with events. Any other people having similar experience?

-- HengMengDIY - 09 May 2003

The first thing to check is that you have the CPAN dependencies installed. v1.008 depends on:

To install these modules from CPAN:

  1. Run: perl -MCPAN -e shell - If this is the first time you've run this it'll ask you to configure it. Do this.
  2. When you get the CPAN prompt type: install Date::Calc - This will do the install for you. Repeat for HTML::CalendarMonthSimple if you don't have it. If you were running v1.006 you probably do have it.

-- DanBoitnott - 09 May 2003

I've just posted a new version to the main package page which corrects a FIXME that was in the original plugin. The plugin is now able to have an event topic on a web other than it's own. I posted it directly to the release page because I've received some help requests related to this issue.

I've also viciously refactored this topic. I've tried to retain bug reports that still apply and feature requests. If you need to reference previous content see version 1.67 of this topic.

-- DanBoitnott - 10 May 2003

I recovered older content and archived it in CalendarPluginDevArchive.

-- PeterThoeny - 10 May 2003

In an attempt to solve MartinCleaver's timezone issue I've made a patch to the HTML::CalendarMonthSimple module to allow an explicit date to be passed in. I've also made a slightly modified version of this plugin to take advantage of it. It works by taking an extra parameter: gmtoffset and using it to calculate today's date. If you live East of Greenwich this value will be positive and can be set with or without the plus sign (+). If you are west of Greenwich you must provide the minus sign (-).

I hope this helps and would be very interested to know one way or the other. If you'd like to see this property in action visit http://www.lclinux.org/twiki/bin/view/Test/CalendarTest.

-- DanBoitnott - 10 May 2003

Looks great Dan, so thankyou. Sorry I've not responded earlier - I've been away on hols.

Marc Kerr says in http://search.cpan.org/author/STRYTOAST/HTML-Calendar-Simple-0.04/Simple.pm "that it was a bit depressing to keep writing modules but never get any feedback. So, if you use and like this module then please send me an email and make my day", so I'm sure he'd appreciate the feedback/modification.

I'd like to strongly discourage you from duplicating the code and forking away from HTML::CalendarMonthSimple; but if you or anyone does have a mod that the author won't take the appropriate place to push the new version is on CPAN where it can be advertised next to the author's version. That way other potential users of the module get the chance to question which version to use and to push for or implement a version with the features integrated.

To back this up, I had confused CPAN:HTML-Calendar-Simple-0.04 with v1.08 of CPAN:Calendar-Simple (released by Dave Cross yesterday, CPANRssNews told me), just suggesting there is enough duplication of effort out there in the CPAN world without the TWiki community forking their work as well.

Lastly, whilst a great way to give feedback to the CPAN author and to provide interim functionality to bleeding-edge users, getting people to patch their CPAN modules is something we should avoid. The TWiki community has not yet standardised on where patched CPAN modules should be placed (see CpanPerlModulesRequirement) and without guidance, some users may be tempted to alter their core version (both bringing instability to other programs that use it and an invitation for some automated update program to wipe over the patched version with the authors new version) or to duplicate the install (potentially confusing for administrators who don't know that their is a locally patched version).

So, in short, patches are at best unorthodox and without some control mechanism are a recipe for confusion.

-- MartinCleaver - 15 May 2003

This plugin (and me, in the process) suffers from being packaged for a Plugins web rather than the TWiki web.

To correct:

  • mv data/Plugins/CalendarPlugin.txt data/TWiki/CalendarPlugin.txt
  • mv pub/Plugins/CalendarPlugin/* pub/TWiki/CalendarPlugin/

This issue was recently discussed about KoalaSkinDev - Colas now provides a second version for those people who don't have a separate Plugins web.

There exists a topic that talks about this issue. I don't recall its name.

Thanks a lot for the new version, Dan.

-- MartinCleaver - 15 May 2003

Also, the data/Plugins/CalendarPlugins.txt file says it is version 1.005 not 1.009.

-- MartinCleaver - 15 May 2003

I've posted a new package which addresses both of the above issues. About the patch: I've been thinking along similar lines. I don't really want to reimplement the calendar functionality in the plugin and it's not the Open Source thing to do. The patch I posted is intended for bleeding-edge users. I've been meaning to send the patch off but haven't had the time. Have you tried it yet? Does it work?

-- DanBoitnott - 16 May 2003

I've sent the patch off for consideration by the author of HTML::CalendarMonthSimple, Gregor Mosheh (stigmata@blackangelPLEASENOSPAM.net) in the hope that he'll integrate it into his next version. I'll keep everybody updated on developments.

-- DanBoitnott - 16 May 2003

Thanks for that Dan. I've not tried the patch because I neither have a cpan override directory (See CpanPerlModulesRequirement) nor root access at my hosting provider. I look forward to Gregor releasing the new version though.

BTW, the documentation bundled using +++ for headings. This does not work on most TWikis, the correct format for a level three heading is ---+++. Ta.

-- MartinCleaver - 17 May 2003

It might be possible to put a patched version of the module in the bin directory (or somewhere else you have access to) and modify the plugin slightly to access it instead. Also, I left the headings as they were when I started work on the plugin. I'll clean them up in the next release.

-- DanBoitnott - 17 May 2003

The author of HTML::CalendarMonthSimple, Gregor Mosheh (stigmata@blackangelPLEASENOSPAM.net) has integrated my patch (with a few changes) into v1.23 of his module. You can now enjoy the gmtoffset option using standard CPAN modules. I've attached a version of the CalendarPlugin below that uses this version of HTML::CalendarMonthSimple.

-- DanBoitnott - 20 May 2003

Fantastic. This is a fine example of how TWiki contributors should work with CPAN authors. Well done.

I'll instruct my hosting provider to upgrade the module and test it ASAP.

Thanks again Dan.

-- MartinCleaver - 20 May 2003

It occurred to me that I would want to be able to add events on the calendar to my MS Outlook schedule. Obviously the way to do this is via internet calendaring schedule (ICS) files. Today I discovered that there is a CPAN module (CPAN:Net-ICal) that does this, but development seems to have petered out last September; I read the developers mailing list archive (http://www.geocrawler.com/archives/3/7859/2002/9/0/) it said:

> After getting very stuck on timezones and how to handle
> recurrences, I got kind of... demotivated about working on this
> stuff. I'd still like to work on it, but I really need other people
> with bright ideas to help out.
> 
> I have a feeling that Apple's new iCal application & hype might
> provoke a  nice little resurge in development of the project.

I guess we need to contact Shane R. Landrum (slandrum AT cs DOT smith DOT edu)/http://www.cs.smith.edu/~slandrum/ and ask him the status of the project; the functionality that is there looked great.

-- MartinCleaver - 24 May 2003

Another implementation: http://search.cpan.org/author/FGLOCK/DateTime-Event-ICal-0.01/

-- MartinCleaver - 24 May 2003 Dan, I just started using the topic= parameter, e.g.

---+Stream A: TermTwoStreamATimetable
%CALENDAR{showweekdayheaders="1", topic="TermTwoStreamATimetable"}%
---+Stream B: TermTwoStreamBTimetable
%CALENDAR{showweekdayheaders="1", topic="TermTwoStreamBTimetable"}%
---+Stream C: TermTwoStreamCTimetable
%CALENDAR{showweekdayheaders="1", topic="TermTwoStreamCTimetable"}%

What I also want to do is have a combined calendar, but the following, and several variants don't work:

%CALENDAR{showweekdayheaders="1", topic="TermTwoStreamATimetable,TermTwoStreamBTimetable,TermTwoStreamCTimetable"}%

Is there a syntax for this already?

Many thanks, Martin.

-- MartinCleaver - 25 May 2003

The plugin won't process two topics at once but you can put together another topic like "TermTwoAllStreamsTimetable" and use it to include the other topics and make it the topic for your combined calendar. An example of this is my event list which has events of it's own and some included from other topics.

-- DanBoitnott - 25 May 2003

Here's my experience installing verion 1.009 of this plugin. I saw some CPAN modules were needed and I felt unhappy. The Perl for this machine was not configured for CPAN but it seemed to work out OK with an auto-configuration rather than a manual config. I noticed that that the Bit::Vector module is a pre-requisite for the Date::Calc CPAN module is a prerequisite for the HTML::CalendarMonthSimple module. I am running a Debian system so I don't know if Bit::Vector is installed by default on other systems so I didn't change it, but I did change the order of the modules listed on the main plugin page. I went to cpan.org and looked in the FAQ and found this command line which I typed and it worked flawlessly perl -MCPAN -e 'install HTML::CalendarMonthSimple'. I hope this helps others who attempt this install.

I also find that my /usr/local/share/perl/5.6.1/HTML/CalendarMonthSimple.pm file is not editable per the instructions at line 197 so I have not performed this edit. I hope I don't get spurious error messages as are promised without this modification. The installation looks to work just fine.

Oops, I also got an error when I run my cron mailnotify script:

Parentheses missing around "my" list at ../lib/TWiki/Plugins/CalendarPlugin.pm line 216.
Useless use of a variable in void context at ../lib/TWiki/Plugins/CalendarPlugin.pm line 216.
Useless use of a variable in void context at ../lib/TWiki/Plugins/CalendarPlugin.pm line 216.
Useless use of a variable in void context at ../lib/TWiki/Plugins/CalendarPlugin.pm line 216.
Useless use of a variable in void context at ../lib/TWiki/Plugins/CalendarPlugin.pm line 216.
Useless use of a variable in void context at ../lib/TWiki/Plugins/CalendarPlugin.pm line 216.

This diff seems to make it mostly work but there's still a problem.

216c216
<     my $currentYear, $currentMonth, $currentDay, $hh, $mm, $ss;
---
>     my ($currentYear, $currentMonth, $currentDay, $hh, $mm, $ss);

Now I get an error of

"my" variable $mm masks earlier declaration in same scope at ../lib/TWiki/Plugins/CalendarPlugin.pm line 281.

So now I'm trying this out. I'm hoping this hunk won't change the functioning of the code.

281,282c281,284
<     my ($descr, $dd, $mm, $yy, $text) =
<        ('',     '',  '',  '',  ''   );
---
>     my ($descr, $dd, $yy, $text) =
>        ('',     '',  '',  ''   );
>     $mm = '';
>

-- GrantBow - 26 May 2003

That was all my fault. I failed to note that $mm was already being used. I've corrected the code and posted it to the plugin page. Also note that this release (v. 1.010) contains the gmtoffset option so I've added it to the documentation. I've also addressed the the documentation issues brought up by MartinCleaver. Sorry about the trouble, I hope this release sets everything right.

As per MartinCleaver's other suggestion, I'm also very keen to get this plugin to sync with a client-side calendar.

-- DanBoitnott - 26 May 2003

Eek. I implemented v1.010 (thanks, Dan, BTW) and all my calendar entries have turned to "!", i.e. point to exclaim.gif! What have I done wrong?!

-- MartinCleaver - 27 May 2003

Hi. This is one of the most useful plugins I install to our TWiki. But I found big problem. When you have more events in one day you are very limited with possible layout formatting.

For example: format =

"<b>$old</b><small>$description</small><br>"
If in one day are two events than only the last event will be in regular font. Previous events will be in bold font.

Well, I changed the handling of events and now you can use two different formats. Format for whole cell and format for description of events. I created new attribute "formatDescription" to use for it. I attach the modified version of script if you want to try it or if you want to implement the changes to this plugin.

-- RichardBaar - 27 May 2003

RichardBaar's problem with items being bolded is in his format string: the <b>$old</b> is what's doing it. Here's how the format string works: When the plugin adds an item to a calendar cell it replaces it's contents with the format string. It takes what was in before and expands $old and expands the new description into $description. Here's my format string, you might give it a shot:

$old<br><small>-&amp;nbsp;$description</small>

I've no idea what the deal is with exclamations on MartinCleaver's site. Is your site public? Is there a way I can see what's going on?

-- DanBoitnott - 27 May 2003

(I switched the usernames the right way around - they had become wrongly signed). I'll send you the URL in an email Dan.

-- MartinCleaver - 27 May 2003

Well, our site is not public but I will try explain what I need and what was wrong with CalendarPlugin before I made the changes. We use the CalendarPlugin for viewing release cycles of our products. And I want to do a page with the calendar where each will see the milestones of each product. I used CalendarPlugin and it was OK till in one day where releases of two or more products. The problem was that with this format:

$old<br><small>-&amp;nbsp;$description</small>
the rendered calendar was almost unreadable. The second problem is that I want the day in bold and with font "+2". Well, I wanted to render each cell as separate table like this:

<table>
<tr><td align='center'><font size="+2"><b>Day XX</b></font></td></tr>
<tr><td align='left'><hr><small>Description for release of product 1</td></tr>
<tr><td align='left'><hr><small>Description for release of product 2</td></tr>
<tr><td align='left'><hr><small>Description for release of product 3</td></tr>
</table>

This wasn't possible with the former way of rendering events, because - as you wrote - each event was added at the end of the old cell content immediately. After my changes, at first is created array of events and then is for each day rendered at first descriptions of each event for this day and last action is rendering the whole content of appropriate day-cell.

Well, I have to say that I am newbie to Perl and maybe the changes are not in Perl-way programming conventions but it works!! :-)))

-- RichardBaar - 27 May 2003

I'd like to pick up on earlier discussion between MartinCleaver and DanBoitnott regarding merging data from multiple calendars. In surveying the desires of folks for calendar features, this ranks very high. While I'm really glad to find out a way to do this that Dan described, I think the feature is important enough to consider implementing it along the lines Martin described.

The other feature that needs to go along with this is being able to designate whether a particular event should be "rolled up" into the more general calendar. This is equivalent to the feature in many group calendaring programs of designating an event as public or private. I can image an additional event variable that designates the event as public (with the default being private).

-- LynnwoodBrown - 27 May 2003

I'm having several problems with the latest release (v1.010). I'm getting a bunch of the following in my error log:

render: Use of uninitialized value in join or string at ../lib/TWiki/Plugins/CalendarPlugin.pm line 123.

I've also got a page that appears to get into some kind of infinite loop. These are the errors:

render: Deep recursion on subroutine "TWiki::Plugins::applyHandlers" at ../lib/TWiki/Plugins.pm line 388.
render: Deep recursion on subroutine "TWiki::handleCommonTags" at ../lib/TWiki/Func.pm line 757.
render: Deep recursion on subroutine "TWiki::Plugins::commonTagsHandler" at ../lib/TWiki.pm line 1957.
render: Deep recursion on subroutine "TWiki::Plugins::applyHandlers" at ../lib/TWiki/Plugins.pm line 299.
render: Deep recursion on subroutine "TWiki::Plugins::CalendarPlugin::commonTagsHandler" at ../lib/TWiki/Plugins.pm line 171.
render: Deep recursion on subroutine "TWiki::Plugins::CalendarPlugin::handleCalendar" at ../lib/TWiki/Plugins/CalendarPlugin.pm line 113.
render: Deep recursion on subroutine "TWiki::Plugins::CalendarPlugin::handleCalendar" at ../lib/TWiki/Plugins/CalendarPlugin.pm line 113.
render: Deep recursion on subroutine "TWiki::Func::expandCommonVariables" at ../lib/TWiki/Plugins/CalendarPlugin.pm line 299.

I looked through the code a bit, but it's been far too long since I've done any Perl. smile Any assistance would be appreciated!

-- SeanTimm - 27 May 2003

Ahh. Having read the code and Richard's comment again I now understand. The ! marks were simply the default compressed 'format' string; for some reason editing CalendarPlugin page and saving it was what I needed to do.

Richard - your change sounds good. Any chance you can produce a version for 1.010? Dan - can you test it and, if you are happy, perhaps you'd like to help Dan get it released as 1.011?

-- MartinCleaver - 28 May 2003

Hi,

I attached version 1.010 with my changes. Changes are:

  • added new attribute weekstartsonmonday
  • added new attribute formatDescription
  • remade the algorithm of generating content of calendar cell as I described above

On our Wiki it works OK but some testing is needed.

-- RichardBaar - 29 May 2003

Hey Richard, I guess something needs a sensible default because I haven't changed the settings but I get the above result when applying your version. Can you either post a new version or (in the meantime) tell me what to change? Thanks! M.

-- MartinCleaver - 29 May 2003

I am sorry!! The reason why you have the output as you have => you have specified attribute format in your CALENDAR variable and you don't specify formatDescription.

In my script default values are:
format

<table width='100%'><tr><td><b>\$day</b></td></tr>\$description</table>
formatDescription
<tr><td align='left'><hr size=1>\$description</td></tr>

I forget to say that now you have to specify both attributes format and formatDescription. Or try to remove from your CALENDAR these two attributes. Than will be used default values from the script. The second thing is that I removed $old makro because now is not needed.

Example of using:

%CALENDAR{topic="aTopic"}%
%CALENDAR{topic="aTopic" format="<font size='+2'><b>$day</b></font><br>$description" formatDescription="$description<br>"}%

Of course it is possible to change the defaults in script to another values and let the script replace the makro $old with empty string for backward compatibility!! I let in attached script default values we use in our TWiki.

-- RichardBaar - 29 May 2003

Don't worry, I much appreciate your changes. It looks a lot nicer now smile

The only thing that I want different now is for calendar items ro remain Wiki-ised. I have entries such as:

But now, when they show in the calendar, they don't link to the associated topic. Once this functionality is restored we can get your changes released as 1.011 of CalendarPlugin!

-- MartinCleaver - 29 May 2003

I figured out the recursive lockup I was seeing. We had a calendar on a page that was referring to another topic for its tasks. However, this topic also had a calendar, and I think this caused it to go into some kind of loop. Moving the events to a completely separate topic works fine for me, but this should probably be fixed somehow since you end up with an "Internal Server Error" otherwise.

-- SeanTimm - 29 May 2003

This might be a bug: if I use one %CALENDAR{}, say to display May 2003, which is fine. However, if I want to display multiple calendars, for example:

%CALENDAR{month="5" year="2003"}
%CALENDAR{month="6" year="2003"}
%CALENDAR{month="7" year="2003"}
Preview will just hang there, no error message return whatsoever. What puzzles me is, in rare occasions, maybe one out twenties tries, I can get it through. Close examination of my system setup doesn't help. Any idea what causes this?

-- OliverWang - 29 May 2003

Hi Martin,

it is strange because I do nothing with this. The rendering of Wiki words should be the same because the only thing I did is another way of filling cells of calendar. This is also strange of this point of view - this happens only when the Wiki word is the first word in description. If there is anything before it then it is rendered correctly. The 'hot fix' is to put the Wiki word into double brackets [[Wiki word]]. I will try to look inside the TWiki code and find better solution.

RichardBaar - 30 May 2003

Hi Oliver,

I tried to put eight calendars on one page and everything is OK. What version of CalendarPlugin do you use??

RichardBaar - 30 May 2003

Hi, Richard,

I tried both 1.10 (latest) and a prior version, both failed. I was kind of frustrated, and almost ready to give up this plug-in, though I'd really like to make it work. Anyway, other system infomation include:

  • TWiki version: 01 Feb 2003
  • Perl version: 5.8.1
  • Web server & version: Apache 2.0.45 (both perl and apache are from rawhide)
  • Server OS: Red Hat Linux 9

-- OliverWang - 02 Jun 2003

Oliver,

I was having a similar problem, but with a few tweaks it's gone away..

--- CalendarPlugin.pm   2003-06-01 14:07:31.000000000 -0400
+++ CalendarPlugin.pm.tweaked   2003-06-02 13:02:27.000000000 -0400
@@ -122,9 +122,11 @@
   my $pattern = "^\\s*\\*\\s+$_[0](\\s+X\\s+{(.+)})?\\s+-\\s+(.*)\$";
   my @lines = split /\n/, ${ $_[1] };

+  no warnings; # lazy_hack
   my @res = (map  { join '|', m/$pattern/ }
             grep { m/$pattern/ }
             @lines);
+  warnings; # /lazy_hack

   # Remove the lines we handled, so that when several patterns
   # match a line, only the first pattern is really honored.
@@ -345,7 +347,7 @@
        foreach $d (@days) {
            ($dd, $mm, $yy, $xs, $xcstr, $descr) = split( /\|/, $d);
            if ($yy == $y && $months{$mm} == $m) {
-             $descs[$y][$m][$d] .= "$descr\|";
+             $descs[$y][$m][$dd] .= "$descr\|";
            }
        }
        # then collect all dates without year

-- TomHowellCintron - 02 Jun 2003

Hi, Tom,

Thanks very much for the patch. It works!!! More details are: there are some errors when applying it to v1.010 (it may not be your running version). And the second modification from $d to $dd doesn't work in my case. The only mofication needed is "no warnings; .... warnings;". Aagin, thanks a bunch.

  no warnings;
  my @res = (map  { join '|', m/$pattern/ }
             grep { m/$pattern/ }
             @lines);
  warnings;

-- OliverWang - 02 Jun 2003

In an effort to get the rendering bug resolved, I have posted the support request FirstWordIsNotLinked

-- MartinCleaver - 03 Jun 2003

Ah, hell, it bothered me enought that I fixed it. This might be considered a hack or it might be considered that there is a problem with the core, I am not sure - see below.

The symptom was that the FirstWordIsNotLinked - the resulting HTML was:

<tr><td align='left'><hr size=1>ManEcon 6 (CUB) 3:30:00 PM</td></tr>

Notice there is no space between the 1>ManEcon - TWiki took this to mean that it should not render the word as a link. Altering $formatDescription to include one did not help:

formatDescription

<tr><td align='left'><hr size=1> \$description </td></tr>

I assume this was because the code that extracts parameters trimmed the space either side. My solution or hack was to alter line 484 from:

  $format =~ s/\$description/$description/g;

To:

  $format =~ s/\$description/ $description/g;

The problem I am concerned about the core is that I believe WikiWords prefixed with a > should result in a link. This will otherwise particularly be a problem when WYSIWYG Editors such as HtmlareaEditor become mainstream. I think addressing the request in BoldTWikiWordsAreNotHyperlinked would solve the problem but I appreciate that it would complicate the current parsing mechanism.

-- MartinCleaver - 03 Jun 2003

I looked at the Multiple calendars thing. Its line 290ish where it says:

  if ( defined $options{topic} ) { 
     ... long ramble of code.

We want something like:

  if ( defined $options{topic} ) { 
  my $topics = split ",", $_;
  for $topic (@topics) {
     ... long ramble of code.
  }

Where ... long ramble of code would be best off in a subroutine.

I need to sleep now, but that's the basic idea.

-- MartinCleaver - 03 Jun 2003

I have a fresh TWiki install, a fresh plugin from the CalendarPlugin page, and fresh installs of the CPAN modules.

I'm getting the following error on every page except the CalendarPlugin page itself, which works. This is similar to the one that SeanTimm reported above, but his was on render: instead of view:

 view: Use of uninitialized value in join at ../lib/TWiki/Plugins/CalendarPlugin.pm line 123.

On the other pages with calendars, I see the calendar, but the events aren't shown at all.

-- KarlJSmith - 18 Jun 2003

Hi everybody. I'm on haitus at the moment trying to complete several major projects at once. I did have a look at line 123 and it appears to be a comment with no joins around. Are you using the main release or a development version of the plugin?

-- DanBoitnott - 18 Jun 2003

I am using the latest main release from the CalendarPlugin topic (v1.010).

-- SeanTimm - 18 Jun 2003

I had another look and found that on that release line 123 does have a join. It is however some of the most mature code in the plugin and I couldn't find a problem just looking at the code. Is the site you're having trouble with public? Can you post a URL I could check out for debugging purposes? Also, though I don't think this is the issue, what version of Perl are you running?

-- DanBoitnott - 19 Jun 2003

I've figured it out. I'm still getting the 'join' warning, but I finally have dates in my calendars. The problem was that I used 'June' instead of 'Jun', and that made all the entries in the calendar itself vanish - I got calendars without any contents. When I checked the logs for errors, I got the join error instead of an 'unparseable date' error, so I assumed something was broken at a higher level, even though it was still working in the example page.

-- KarlJSmith - 23 Jun 2003

Hey everyone. I'm setting up an equipment booking system. There is one Calendar topic page for each piece of equipment. The users can add the date and their name after it, and this will get stuck into the Calendar. I'd like to be able to extract the number of days a user used a certain machine, for billing purposes. I'm looking at the CalendarPlugin.pm file and trying to use the event parsing function in there, and all the regexp for that. And every time I see an occurence of some person's name in the description of an event, I'll increment the number of days associated with their name in a hash table. It's not working right now, because I suck at Perl currently... I was just wondering if anyone knows any quick or easier ways to do this? Currently I'm just trying to make a Perl script which will extract info from the wiki topic's text file source.

-- DavidGrant - 07 Aug 2003

Anyone else have problems printing this? The grid lines don't come out making it really hard to read.

  • I was experiencing this also and thought it a bug. Then I realized it was because I had "print background colors" turned off in my browser print options. -- LynnwoodBrown - 22 Mar 2006

-- MartinCleaver - 13 Aug 2003

I too have the stupid join problem on line 123. It's trashing up my web server's error log. Has anyone moved forward on finding out why this occurs?

If I add:

$_[0] = "";

before the line, the problem goes away. It appears as if fetchDays is sometimes being passed an uninitialized value or something along those lines.

My error_log and disk quota would appreciate a fix for this. smile

-- TedPavlic - 16 Aug 2003

Regarding this plugin, I developed a calendar processing engine to track workhours using algorithms supplied in the implementation by Gred Hewgill at the link below. I believe this plugin could do away with requiring external packages and could generate the table internally which would provide more flexibility:

http://www.perl.com/language/ppt/src/cal

This is what I used in my QuickCalendarPlugin.

-- JonathanCline - 22 Aug 2003

I've partly tracked down the "Use of uninitialized value in join or string at" error at line 123.

The two values that are passed into fetchDays as $_[0] which trigger this message are:

  • ([0-9]?[0-9])\s+(Sep|May|Jul|Jun|Jan|Nov|Aug|Mar|Feb|Dec|Oct|Apr)\s+([12][0-9][0-9][0-9])
  • ([0-9]?[0-9])\s+(Sep|May|Jul|Jun|Jan|Nov|Aug|Mar|Feb|Dec|Oct|Apr)

I'll update here if I find a fix.

-- DeWittClinton - 22 Sep 2003

Enhancement request/proposition: allow for comments in calendar entry lines that are not rendered in the calendar itself. Thereby all essential information about an event can be kept at one place without using too much place in the calendar rendering. In my quick fix, everything after (and including) the pipe symbol is removed from the rendered entry (named $descr or $description in the perl module). For example, in

  • 09 Oct 2003 - patch CalendarPlugin | allow for comments in calendar entries
only "patch CalendarPlugin" would appear in the calendar. Here the patch against stock version 1.010:
*** CalendarPlugin.pm.orig      Mon May 26 17:44:03 2003
--- CalendarPlugin.pm   Thu Oct  9 14:58:01 2003
***************
*** 464,469 ****
--- 464,471 ----
        my ($c, $day, $description, %options) = @_;
        my $old = $c->getcontent($day);
        my $format = $options{format};
+         # NB: delete comment after | symbol
+         $description =~ s/\|.*//;
        $format =~ s/\$description/$description/g ;
        $format =~ s/\$web/$options{web}/g ;
        $format =~ s/\$topic/$options{topic}/g ;

-- NilsBluemer - 09 Oct 2003

Nils, how hard would it be to put comments in a title attribute for the table cell or content?

-- SamHasler - 09 Oct 2003

Anybody have a problem where having more than ten bullets (date inputs) on a page cause the calendar to stall. i.e. 10 bullets and the calendar pops up. 11+ bullets and it thinks a long time till I run out of patience. As it is, I've divided up my calendar into categories to keep less than 10 events per page.... any ideas why this happens?

Installed I have, according to testenv Date::Calc (5.3) Warning: 'Date::Calendar' not installed - check TWiki documentation to see if this is required. HTML::CalendarMonthSimple (1.23) Operating system: Unix (redhat linux) Perl version: 5.8.0

BenjaminFleischer - 10 Oct 2003

I'd like to suggest an enhancement for included calendars. I would like to see people maintain individual calendars (TWikiNameCalendar) and then include them into group and project calendars. This should be possible with 1.009 and later. What I think would enhance this ability is to be able to specify a prefix for included calendars. This could be used to prefix people's events with their TWiki name. This would allow people to maintain their vacation schedules in one place, but have them show up on all calendars that include their events.

For example, on my calendar I'd have something like `` * 20 Dec 2003 - 26 Dec 2003 Vacation''. So on my personal calendar it would show up as ``Vacation''. On the group calendars I would like to prefix it with JeffreyHonig so the event would be listed as ``Main.JeffreyHonig Vacation''.

-- JeffreyHonig - 29 Oct 2003

I get a lot of:

view: Argument "L" isn't numeric in numeric eq (==) at ../lib/TWiki/Plugins/CalendarPlugin.pm line 409.
which is from:
if ($dd == "L") {
which should be:
if ($dd eq "L") {
(the "==" changed to "eq"). This happens when you use the L for last day in a month repeating event.

-- SandyMcArthur - 29 Oct 2003

Can anybody help me with the CalendarPluginUndefinedSubroutine ?

Thanks !
-- KeithHelfrich - 29 Oct 2003

As an alternative to my previous problem (Internal Server Error/timeout when source page has >10 bullets), is there a simple modification to the source code to only pull out weekly events? I made my own calendar using recursiverender and it would be great to have a headlinesplugin-like ability to create a table with each cell having specific date information. Specifically, I'd like to have headlines for "Monday" with a link to the source page which contains more information, while using the CalendarPlugin lingo to specify which 'headlines' to pull.

Current code is

~calendar-row
~calendar-day-begin-weekly [[WeeklyCalendar#Sunday][Sun]] ~line 8pm Frisbee ~calendar-day-end
~calendar-day-begin-weekly [[WeeklyCalendar#Monday][Mon]] ~calendar-day-end
~calendar-day-begin-weekly [[WeeklyCalendar#Tuesday][Tue]] ~line 6pm Soccer ~calendar-day-end
~calendar-day-begin-weekly [[WeeklyCalendar#Wednesday][Wed]] ~calendar-day-end
~calendar-day-begin-weekly [[WeeklyCalendar#Thursday][Thu]] ~line Poker at Leo's? ~calendar-day-end
~calendar-day-begin-weekly [[WeeklyCalendar#Friday][Fri]] ~line 11am Football ~calendar-day-end
~calendar-day-begin-weekly [[WeeklyCalendar#Saturday][Sat]] ~line 7pm Karate ~calendar-day-end

-- BenjaminFleischer - 06 Nov 2003

Well, I think I figured out what is causing the "Use of uninitialized value in join at 123" problem. Our calendar event file not only contains dates and events, but it also contains headers, comments and other nice things so it, too, is a TWiki page that displays nicely. All of those non-event lines are causing the errors. It is trying to parse out the date of the event. For those lines without dates, the uninitialized value results. Now that we understand it, since the events still render fine in the calendar, and since we want those headers, etc., we are just going to use the "no warnings" hack above to eliminate the log messages. Perhaps some Perl person could fix the script to ignore lines without valid dates.

-- SteveCooper - 13 Nov 2003

I have made progress but still need assistance with CalendarPluginUndefinedSubroutine -- please assist if possible. Thank you!

-- KeithHelfrich - 09 December 2003

I am having problems with 13+ events. 13 events - The calendar works. Add the 14th event - Stops working. Can someone tell me how to fix this. This plugin is great but with this restriction going to be tough to use.

-- ZrbZrajbun - 21 Dec 2003

The following changes were made to plugin version 1.010 to get rid of the apache error log warning:

Use of uninitialized value in join or string at /twiki1/httpd/twiki-bin/b/TWiki/Plugins/CalendarPlugin.pm line 123.

Diff:

123,124c123,125
<   my @res = ( map { join '|', ( map { $_ || "" } m/$pattern/ ) }
<            grep { m/$pattern/ } @lines );
---
>   my @res = (map  { join '|', m/$pattern/ }
>            grep { m/$pattern/ }
>            @lines);

-- PaulineCheung - 24 Dec 2003

I created and uploaded a new Plugin version V1.011 that:

  • Shows now unsaved events in preview
  • Improves performance and lowers resource requirements
    • Could someone test if the limit on number of events is gone now?
  • Documentes most of HTML::CalendarMonthSimple attributes
  • Fixes a deep recursion bug
  • Fixes uninitialized value in join bug

To do:

  • The Date::Calc module is always loaded, also if there is no CALENDAR in a page. It should load only when needed (like HTML::CalendarMonthSimple)

-- PeterThoeny - 03 Jan 2004

I have a number of topics which use searches to collect events from different topics into a single one so they can be displayed in the same calendar in another topic using a topic="TopicContainingSearchForEvents" parameter. This stopped working when I upgraded from 1.010 to 1.011.

Is there a different way of collecting events from a large number of topics?

-- JensMadsen - SamHasler - 16 Jan 2004

Oh, I did not know it was used that way. What does work is a bunch of INCLUDEs of topics with events (in the calendar use HTML comments if you do not want to show the events).

The code can be fixed so that SEARCH also works. If possible there should be no performance penalty for calendars that do not use SEARCH.

-- PeterThoeny - 16 Jan 2004

Is it possible to have an yearly calender in one syntax?

-- JaiPrakash - 20 Jan 2004

I've just made changes to allow specification of multiple entries in the topic= parameter, e.g topic="Web.Cal1, Web.Cal2".

Am not sure how robust the change I have made is - perhaps someone could test it under their system and post any changes. If i hear nothing I've release this as a new version by the end of the week.

-- MartinCleaver - 18 Feb 2004

This plugin does not work with perl 5.005_03. It seems to be confused by the "our" declarations (starting on line 335). So, you may want to change the versions of perl that you claim it works with and/or fix the code to work with 5.005_03.

-- JordanShare - 19 Feb 2004

did you get it to work under perl 5.005_03? if so, could you please attach a unified diff (diff -u) patch to this topic?

-- WillNorris - 19 Feb 2004

Ah, no. I've not really put any effort into it at all (never having coded in perl before). I may take a stab at converting all the "our" to "my", but if that doesn't "just work", then I'm at the limit of my ability. smile

-- JordanShare - 19 Feb 2004

I just installed the latest version to eliminate the uninitialized value at line 123 error, but now I'm seeing the following error the httpd log:

  • Odd number of elements in hash assignment at /home/httpd/twiki/lib/TWiki/Plugins/CalendarPlugin.pm line 522.

It doesn't appear to be affecting the calendars we have instantiated on our site, but I figured I'd report it.

-- SteveRosenthal - 01 Mar 2004

  • This has been fixed in V1.015 of the plugin. -- DB - 11 Mar 2005

Thanks Steve. I thought this was my fault but I don't think so now. It is also not obvious to me what is going wrong.

A couple more comments to add to the pile:

  1. our %months = ( Jan=>1, Feb=>2, Mar=>3, Apr=>4, May=>5, Jun=>6, Jul=>7, Aug=>8, Sep=>9, Oct=>10, Nov=>11, Dec=>12);
    • This means that if the user does not abbreviate the month correctly then the entry does not go in.

  1. $text =~ s/ Warning: Can't find topic (.)
/&expandIncludedEvents( $1, $options{web}, $options{topic}, () )/geo;
    • I think this could be expanded to call expandIncludedEvents for existing %CALENDAR lines - hence allowing inheritence of calendars
  1. The %CALENDAR takes month="03" but not month="Mar.*". This is confusing.

-- MartinCleaver - 06 Mar 2004

If you precede your event text by the time, then it turns out that the code benefits from the word 'sort' being inserted before the grep on line 356. This way your events are time ordered in the grid.

    # keep only bullet lines, and sort (so that event descriptions preceded by times appear in time order)
    my @bullets = sort grep { /^\s+\*/ } split( /[\n\r]+/, $text );

It'd be useful if the next person to release includes this in the code.

-- MartinCleaver - 07 Mar 2004

I ran across the hash error mentioned above and I believe this fairly ugly hack fixes it (or at least shows the problem, the %options is trying to eat all the things in @_). I don't remember the way to do this with Perl references (probably cleaner).

sub getTopicText {
    my $refText = pop @_;
    my $theWeb = pop @_;
    my $theTopic = pop @_;
    my %options = @_;
    ...
-- EricVarsanyi - 12 Mar 2004

Thanks Eric.

Incidently, anyone else seen a problem on XP/IE where each calendar entry shows only one word per line, regardless of how wide you make the window and regardless of the skin you use? See the 3 Mar 2004 for an example (sneaky midweek drink could go on one line).

Solved!

Great, thanks a lot Dan.

  • not-sized-properly.jpg:
    not-sized-properly.jpg

Dan added a width="100%" parameter (and a format="$old
-  $description") that solved this problem.

-- MartinCleaver - 13 Mar 2004

How can we change the color of an item in an individual cell? Or can we?

-- CharlieSmith - 15 Mar 2004

Has anyone given consideration to extending CalendarPlugin to:

  • Accept events defined with a time and duration?
  • Accept events defined with a time zone?

We've got the fairly typical problem of keeping people spread all over synchronized for meeting schedules.

-- BradDixon - 02 Apr 2004

CVS version has been brought up to match zip version 1.16 (which is version v1.013 of the plugin)

-- MattWilkie - 02 Apr 2004

I've attached a patch against the V1.013 version of this plugin which adds some features:

  • Support for events with time specifications.
  • Support for timezones.
  • Modifiable headers with $month, $year, and $tz variable substitution via the header option.
  • Modifiable date formats in cells with $date and $n variable substitution via the datenumberformat .
  • A new variable $time for the format option.

The event w/time parsing is done via the Date::Parse option. If Date::Parse is not present the plugin will function without it with obvious limitation. Acceptable format:

  • DD MON YEAR HH:MM (am|pm) GMT[+-]?\d?\d?

Current limitations:

  1. If you fail to specify a zone for an event or calendar you get the default TZ value or GMT.
  2. No repeating event support for date/time based events. Existing syntax for repeating events with dates only still works as before.
  3. No duration support (1pm-3pm).
  4. You can not use timezone abbreviations like PST, EDT, etc. These are all non-standard and non-unique. There are two EST's in common use, for example.
  5. I split the event string on '-' chars and then feed it to Date::Parse. Everything that comes after '|' in an event is a comment. You can not use '-' chars within your event description since it will hose the parser. I couldn't dream up a fancy enough regexp so I slacked off and used split.
  6. Makes no attempt to account for daylight saving time. If you've ever looked at those rules you would know why. The creators of calendar events and calendars must specify their GMT offset appropriately.

I am using this locally with these options set in CalendarPlugin:

      * Set TZ = GMT-7
      * Set DATENUMBERFORMAT = $date$n
      * Set FORMAT = $old|$time|$description|$n
      * Set HEADER = <center>$month $year ($tz)</center>
This results in a calendar with tables in each cell listing events ordered by time. I then display my local calendar with:

%CALENDAR{tz="GMT-4"}%

This shifts all of the events for display in my local timezone.

I've done some quick sanity checking but would appreciate commentary.

-- BradDixon - 14 Apr 2004

Brad, useful enhancements. Could you elaborate on "No repeating event support". Is the existing functionality taken away with your patch?

-- PeterThoeny - 15 Apr 2004

Peter: No modifications to the existing parseable formats or features was made. The modification is backwards compatible with existing syntax. I just added an additional parsing function to the end of the parse chain that looks at any remaining bullets. Repeating events would be nice and maybe I'll get around to them. I've modified my earlier feature list to be more descriptive.

-- BradDixon - 15 Apr 2004

I just thought that the tz attribute is not linked to the gmtoffset attribute. This means that if you request a calendar display in your local timezone the events are mapped to that timezone but the calendar itself is not. This would be hard to notice except for circumstances where the timezone of the server puts it in a different day from the requested tz. I'll fix that in a bit.

-- BradDixon - 16 Apr 2004

New version of the patch uploaded. This version has two attributes controlling the local timezone of the calendar:

  • gmtoffset: Specified as +/- hours.
  • tz: Specified as GMT[+/-] offset.

tz takes priority over gmtoffset. Both may be specified in TWiki.CalendarPlugin or as an attribute. While two parameters are redundant I felt it was important to maintain consistency with the syntax used to specify events. I would suggest using one or the other option exclusively to avoid confusion. To test ensure that these two calendars highlight different days:

February 2024
        01
First of the month
02
Andrea's birthday
03
04 05
Every Monday
Every Monday
06 07 08 09 10
11 12
Every Monday
Every Monday
13 14 15 16 17
18 19
Every Monday
Every Monday
20 21 22 23 24
25 26
Every Monday
Every Monday
27 28 29    

February 2024
        01
First of the month
02
Andrea's birthday
03
04 05
Every Monday
Every Monday
06 07 08 09 10
11 12
Every Monday
Every Monday
13 14 15 16 17
18 19
Every Monday
Every Monday
20 21 22 23 24
25 26
Every Monday
Every Monday
27 28 29    

-- BradDixon - 19 Apr 2004

I have a problem with sequence of execution with the Calendar. I am trying to put together many calendars into one. I have one way which works: a calendar generating topic with the topic= pointing to a topic which includes other (events lists) topics. Why can't I do it the other way: including the calendar at the end of the page including other topics, of course this time without specifying topic=.

It looks like this:

%INCLUDE{AlainMivilleDeChene}%
%INCLUDE{Holidays}%
%INCLUDE{OneYear}%

where the OneYear topic looks like this:

%CALENDAR{showweekdayheaders="1" month="-1" }%
%CALENDAR{showweekdayheaders="1" }%
%CALENDAR{showweekdayheaders="1" month="+1" }%
%CALENDAR{showweekdayheaders="1" month="+2" }%
%CALENDAR{showweekdayheaders="1" month="+3" }%
%CALENDAR{showweekdayheaders="1" month="+4" }%
%CALENDAR{showweekdayheaders="1" month="+5" }%
%CALENDAR{showweekdayheaders="1" month="+6" }%
%CALENDAR{showweekdayheaders="1" month="+7" }%
%CALENDAR{showweekdayheaders="1" month="+8" }%
%CALENDAR{showweekdayheaders="1" month="+9" }%
%CALENDAR{showweekdayheaders="1" month="+10" }%
%CALENDAR{showweekdayheaders="1" month="+11" }%

The first two includes transport the events lists but the last include doesn't take the events into account. Blank calendars are generated.

-- AlainMivilleDeChene - 20 Apr 2004 (previously posted 26 Oct 2003, not a comment since!)

How about a way to use a timezone that handles daylight savings time, and perhaps non-integer timezone offsets? I'm talking the TZ environment variable format here. And this is still suboptimal as the info will be based on the server, not the client, right?

On a different topic, I want to have a "group calendar" that is the union of the calendars of the people in the group.

My preference would be to have a page that contains:

  • an itemized list of the members
  • the current month
  • the next month

and the problem is this means that any time we add/remove a person it has to be done in 3 places. Is there a better way?

-- HarlanStenn - 21 Apr 2004

Alain:

February 2024
        01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29    

already works - does it do what you want?

Dan & I spoke about month back and forth - we think we have a workaround but I'll let him explain as he wrote it.

-- MartinCleaver - 21 Apr 2004

Yes, it works, thanks, I just have to duplicate the info 3 times for my above example. I'd rather have a single "list" that I can use multiple times.

-- HarlanStenn - 21 Apr 2004

I was having a the following error

view: Odd number of elements in hash assignment at ../lib/TWiki/Plugins/CalendarPlugin.pm line 522.
The attached patch against 1.013 fixes it.

-- NicholasSushkin - 23 Apr 2004

  • This has been fixed in V1.015 of the plugin. -- DB - 11 Mar 2005

Is it possible in addition to lists, to collect calendar entries from tables whose first column is a date?

-- NicholasSushkin - 23 Apr 2004

Could anybody help me, is there a script to convert iCal-files (.ics) to CalenderPlugin text. Or is there an other EASY WAY to export and import iCal-files? Thanks ...

-- MarcPilloud - 28 Apr 2004

I just added a patch for the current revision 1.013 which fixes the initialization of the LANG attribute from the CalendarPlugin topic, which was broken.

-- JensKloecker - 30 Apr 2004

HarlanStenn: Sorry it took me so long to get back to you. New baby.

I really wanted to use non-integer TZ strings. The problem is that all of the popular three letter acronymns are non-standard. There are two "EST" timezones: one in the US and one in Estonia. Which is the right one? The zoneinfo you speak of gets around this by using long TZ specifications like "America/New York". I'd rather just type "GMT-4", frankly!

Daylight Saving Time is a total mess. The rules are totally local and depending where you live change every year. The OS might have correct information but since I don't know for sure I felt it better, at first, to leave it in the hands of the user. If anyone has suggestions I'm all open.

On your other issue about having an itemized list of members and duplicating it to multiple calendar topics: I would recommend installing the TopicVarPlugin. I use that with CalendarPlugin quite sucessfully:

Everyone has a personal calendar with an EVENTS variable:

To display his calendar he would do a:

%CALENDAR{topic="%Home.BradDixonCalendar.EVENTS%" tz="%Home.BradDixonCalendar.TZ%"}%

Then you have a single place to define what events and timezone you prefer.

Q: Is this modification suitable for inclusion in the CVS version? If it is I would like to merge it.

-- BradDixon 11 May 2004

Trying to specify every Tuesday from 28 Sep 2004 - 16 Nov 2004 inclusive. Entered:

   * 28 Sep 2004   - 19:00 cuisine Thai
   * 05 Oct 2004   - 19:00 cuisine Thai
   * 12 Oct 2004   - 19:00 cuisine Thai
   * 19 Oct 2004   - 19:00 cuisine Thai
   * 26 Oct 2004   - 19:00 cuisine Thai
   * 02 Nov 2004   - 19:00 cuisine Thai
   * 09 Nov 2004   - 19:00 cuisine Thai
   * 16 Nov 2004   - 19:00 cuisine Thai

but would have preferred something like
E Tue 28 Sep 2004 - 16 Nov 2004 - 19:00 cuisine Thai

Is there an appropriate short formulation for this?

-- AlainMivilleDeChene - 10 Sep 2004

Facing the same problem as Alain above (trying to specify like every friday from startdate to enddate), I tried with the exception format but that didn't help either. Am I right nothing like that is supported ? Or am I overlooking something? Using version 1.013 here.

-- WimLivens - 09 Nov 2004 (actually AndreBonhote posting)

Great plugin! It needs a little bit of patching, but can work with the HtmlAreaEditor. The pertinent part of the patch is this:

     # keep only bullet lines
-    my @bullets = grep { /^\s+\*/ } split( /[\n\r]+/, $text );
+    my $parser = HTML::TokeParser->new(\$text); #tko
+    my @bullets = ();
+    my $li;
+    while ($parser->get_tag("li")) {
+        $li = "* "; 
+        $li .= $parser->get_text();
+        push @bullets, $li;
+    }

You also need to install and use HTML::TokeParser for this patch, although you could definitely handle the html in other ways.

I also removed the line from htmlarea that convereted quotes to html-entity quotes (" to "). If you wanted to keep that, you'd have to change CalendarPlugin to handle reading those in calendars, because otherwise it just prints a lot of default calendars.

-- TerriOda - 19 Sep 2004

Not sure if this is the right place for feature requests, but how 'bout a setting that would display the week number?

-- ChrisRing - 07 Oct 2004

I just installed the latest version, and noticed some 'Odd number of elements in hash assignment' errors showing up in my apache logs. The culprit is here:

sub getTopicText {
   my (%options, $theTopic, $theWeb, $refText) = @_; 
   ...

Unless the 'greed' rules have changed in recent versions of perl, you probably want to pass '%options' as a reference (\%options) - or pass it as a hash as the last argument to the function. I'd be happy to provide a diff against the current module if that would help.

UPDATE Patch attached - still getting used to the Wiki-worldview :).

-- PhilRhinelander - 04 Nov 2004

  • This has been fixed in V1.015 of the plugin. -- DB - 11 Mar 2005

To all: Unless what you are doing is contraversial there is no need to even ask. Please alter the plugin source and re-release it. We trust you. Thanks!

-- MartinCleaver - 04 Nov 2004

Thanks, BUT, that's not what I meant! Phil - just make a new version of the plugin and re-release it as a new version (i.e. zip) on the topic CalendarPlugin. Otherwise everyone has to apply your patch even though you are the best person to apply it! Thanks again!

-- MartinCleaver - 04 Nov 2004

Some odd interactions - side effects.

  1. If I %INCLUDE a file of the bullet-list date items they appear in the calendar
  2. If I also have a topic="..." then the %INCLUDE bullet-list of date items not longer appears in the calendar

and also

  1. If I %INCLUDE a file that generates a bullet list, for example by mens of a %SEARCH, then that doens't appear in the calendar.

-- AntonAylward - 12 Nov 2004

I am concerned about the quality (or lack thereof) of this Plugin. This is a very important Plugin, part of the TWikiMission.

-- PeterThoeny - 13 Nov 2004

Having problems with events. Following the instrucitons on the documentation page: * 10 Nov 04 - test

February 2024
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
        01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29    

Shows me a bulleted line  * 10 Nov 04  test And then a calendar  but the 10th ov November is not highlighted. Am I a bone head? Could someone provide a woking copy of the proper systax for me to go on? TIA!

-- ScottCarroll

Yes, Peter, I'm concerned too. I thought of this as an important and key feature as well. I look-see many other sites have calendars on their front pages. It is an important part of a portal as well as of applications. I would like to think that the portal calendar would be small -- in the menu bar area perhaps. But how do you get the links to work? See the problem described below.

Further experimentation uncovers continuing problems:

  1. Since the %INCLUDE doesn't work reliably, I tried for the topics="..." syntax. That doesn't work as documented a I tried categorizing the events ... CalendarMeetingEvent, CalendarVacationEvent, CalendarConferenceEvent ... and using topic="Calendar*Event"
    The wildcard doens't get expanded. This is not a Windows anomaly, I check in a Cygwin command line. a I tried explicit topic names:- topic="CalendarMeetingEvent,CalendarVacationEvent,CalendarConferenceEvent"
    That produces entries in the calendar, but the URL link is the comma list, not a single topic.
  2. The "Set FORMAT =" doesn't seem to want to be over-ridden in the file topic containing the %CALENDAR directive.

What would be nice: have multiple entries in each date square, color-coded according to their cource. Getting that 'table within each date' stuff to work isn't a happy task.

Could someone -- Martin? -- see about rationalizing and condensing the various patches, please.

-- AntonAylward 15 Nov 2004

See BuildingCalendarPluginEventsWithINCLUDE

This problem dates back to 2002 and while Peter has suggested a fix, it still seems to be a problem. In CalendarTable the %SEARCH technique is used to build the bullet list from a table. Nice idea, not least of all because the EditTablePlugin allows date fields to be edited in the format that CalendarPlugin expects. I tried this on my own machines and it still doesn't work.

-- AntonAylward - 16 Nov 2004

It looks like the format/formatDescription capability that RichardBaar added back in May 2003 has been merged out. It seems that subsequest changes refered to a previous iteration and we lost this capability. As things stand, you can either go back to the version 1.010 and loose later fixes and capabilities, or use the later ones and use the ability to format the date cells as tables.

I had a quick look at the diff between the two, it doens't seem like a trivial change to merge both streams.

-- AntonAylward - 18 Nov 2004

If someone could explain HOW to installs those CPAN plugins on a hosted site, I'd really appreciate is; I looked at those CPAN plugins and can't begin to understand how to get them going. Thanks

-- BartLouwagie - 22 Nov 2004

Bart - I sent a request to my web hosting service to get them to install the needed modules. They did some testing on the modules and then installed them. Took about a day to do this. I didn't have to do anything about installation per se.

-- SueLocke - 22 Nov 2004

It has been a while since I checked in here. I was hoping to see that there had been additional discussion on adding the support for timezones that I created on 14 Apr 2004. ( Patch ) Looks like that didn't go anywhere. Should I be doing something differently? I guess it does say feel free to modify. smile

Since that time I've been using CalendarPlugin as my exclusive calendar system as have a number of other individuals at my company. Other features that people would like are:

  • Repeating events with times & timezone support and a manner for displaying event duration
    • This will be a parser change and then a modification to the code that generates the sorted list of events for each day. I figure this could be done with spans.
  • Calendar "convenience" features. These could (and should, I think) be a seperate plugin.
    • A date "picker"
    • Widgets to delete or move an appointment by clicking on it.

For fun I also created a non-TWiki based perl script that parses my calendar and any referenced calendars and then sets a local "alarm" using the Linux at command to run a script. The script can do whatever you please (email, play a sound, reboot your computer). I've attached it in case someone is interested. It is great to be able to have someone set a calendar event in wiki-space and be reminded of it when it comes around to time.

-- BradDixon - 14 Dec 2004

It would be nice if TWiki would accept an mdash (—) in place of a ndash (– / -) the former confuses users who come in from a pasted MS Word document.

-- MartinCleaver - 15 Dec 2004

Hi, nice plugin I am in the process of expanding it to accept $m and $y in the topic field, and perhaps a wildcard too, so that I can take topics from "Calendar$y$m*" and get Calendar200412Heikki and other users in the same. The $y$m already works nicely, and that will actually be sufficient for my needs, I can list all my colleagues by hand (small company).

Perhaps I add an option not to display the calendar in a grid, as there isn't much room in such. A simple list format might be more suitable for my needs. Not for everyone, of course.

My question is actually what to do with my changes, once I'm done? What is the best way to submit a patch?

-- HeikkiLevanto - 21 Dec 2004

I guess most people using the Calendar Plugin have worked this out already but if you're like me and are just finding out more about the capability and limits of this Plugin it might be of interest. Servertime variables can be used in place of the fixed month and year settings to save on maintenance effort. The documentation page for the plugin doesn't reference this so I thought it might be worth mentioning here.

In response to a query from one of my users I implemented a pull down menu of months to sit just above the calendar so that users can browse calendar events by month. To do this, with my current knowledge of TWiki, meant that I needed to build separate calendar pages for each month. If it is of interest the code I used for the drop down list box is:

<form name="selectType" action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/" >
<select name="type" size="1" onchange="document.location=this.value;"> 
<option value='#'><Nop>Select a month...</option><option value="URL">December 2004</a></option>
<option value="URL">January 2005</a></option>
<option value="URL">February 2005</a></option></select>
</form>

If there is a smarter way of doing this I'd be glad to hear it.

-- SueLocke - 18 Dec 2004

Sue - Here's a possible alternative approach that would not require separate topics for each month. Define the calendar with the attributes for year and month referencing url parameters with defaults of current month & year. Then create a form with separate drop downs for year and month with a submit button that refreshes the topic adding the url parameters. I haven't tried this for calendars but used this general approach successfully in TopicClassificationAddOn to offer multiple views of data within a single topic.

-- LynnwoodBrown - 18 Dec 2004

Thanks Lynnwood I'll give it a go. I like the direction you're taking with TWiki applications.

-- SueLocke - 20 Dec 2004

Sue - Thanks for encouragement on TWikiApplications! smile I was curious if the approach I suggested to you would really work with CalendarPlugin, so I tried it. It does work and you can see a working example here.

Here's the html code:

%CALENDAR{year="%URLPARAM{"year"}%" month="%URLPARAM{"month"}%" showweekdayheaders="1" }%

*View a Different  Month & Year*:
<form action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%BASEWEB%/%TOPIC%">
Month:<select name="month" >
  <option SELECTED value="" > Select...
  <option value="01" > January
  <option value="02" > February
  <option value="03" > March
  <option value="04" > April
  <option value="05" > May
  <option value="06" > June
  <option value="07" > July
  <option value="08" > August
  <option value="09" > September
  <option value="10" > October
  <option value="11" > November
  <option value="12" > December
</select>
Year: <select name=year>
  <option selected value="" > Select...
  <option> 2000
  <option> 2001
  <option> 2002
  <option> 2003
  <option> 2004
  <option> 2005
  <option> 2006
  <option> 2007
  <option> 2008
  <option> 2009
  <option> 2010
</select>
&nbsp;<input type="submit" value=" &nbsp;Refresh&nbsp; ">
</form>

It occurs to me that you could also use this approach for selecting different topics containing the events lists.

-- LynnwoodBrown - 23 Dec 2004

Rather than placing HTML in your pages you could wrap this in a CommentPlugin UserTemplate ; alternatively, Lynnwood, do you fancy releasing the plugin to incorporate your changes.

-- MartinCleaver - 23 Dec 2004

Lynnwood - I tried this out, added in the attribute for a page carrying the events, and threw in a few others for good measure. It works brilliantly. Thank you so much. It is amazing. This is what TWiki is all about - innovation, creativity and generosity.

-- SueLocke - 24 Dec 2004

Hi! I found a bug in the nice CalendarPlugin. The fetchxmap subroutine never ends when you select the month December and define an exception range that ends with December. For Example:

  * E21 14 Jan 2005 X {14 Feb 2005 - 31 Dec 2005} - test
%CALENDAR{month="12"}%
A possible bug fix is to change the condition $m1 > $m of line } until ($m1 > $m || ($m1 == $m2 && $d1 > $d2)); in fetchxmap subroutine of CalenderPlugin.pm to
$m1 <nop>!= $m
.

-- DanielRohde - 07 Jan 2005

Hi again! I found the next bug in the very nice CalendarPlugin. The periodic repeater handling hangs (endless loop) if you define a future event with a large repeating count, e.g:

  * E42 18 Apr 2005 - test
%CALENDAR{month="4"}%
%CALENDAR{month="5"}%
To fix this bug it is possible to change the '# collect periodic repeaters' loops of the handleCalender subroutine of CalendarPlugin.pm: (after the line if (($mm <= $m && $yy == $y) || ($yy < $y)) { )
            until (($yy>$y)||($yy == $y && $mm == $m)) {
                ($yy, $mm, $dd) = Add_Delta_Days($yy, $mm, $dd, $p);
            }
            while ($yy == $y && $mm == $m) {
                if ($xmap[$dd]) {
                    &highlightDay( $cal, $dd, $descr, %options );
                }
                ($yy, $mm, $dd) = Add_Delta_Days($yy, $mm, $dd, $p);
            }
I added the condition $yy>$y to the until loop and I changed the do {...}while (...) loop into a simple while-loop.

Security issue: Denial of service attacks are possible if a CGI program hangs on an endless loop.

-- DanielRohde - 10 Jan 2005

So what is the chance of getting %SEARCH generated bullet lists to work with the CalendarPlugin again (using %INCLUDE or topic="..." )? It used to work great on our local TWiki, until it was upgraded to CairoRelease

-- ThomasOstergaard - 11 Jan 2005

Slim, unless someone picks up maintenance of this plugin. I don't use it myself, so I wouldn't be a good maintainer, before you ask!

-- CrawfordCurrie - 17 Jan 2005

Bug report: You get an Internal Server Error if you look at a page with a calendar that lists an invalid date such as 29 Feb 2005. This should be more forgiving, e.g. the faulty event bullet should be ignored.

Error in Apache log:
Date::Calc::Date_to_Days(): not a valid date at /path/to/twiki/lib/TWiki/Plugins/CalendarPlugin.pm line 381.

-- PeterThoeny - 21 Jan 2005

I updated CalendarPlugin to include monthly repeaters with start and stop dates like AlainMivilleDeChene requested on 10 Sep 2004 and I needed for my use of the calendar to manage shift work. I bumped the version to 1.014 and put out a new zip distribution of it. Docs are updated to reflect this change.

-- NathanKerr - 28 Jan 2005

I'm trying to modify the calendar header using the attribute header="..." . The instructions for this attribute say to use $m and $y for month and year but these do not seem to be working - i.e. I simply get "$m $y" in the header. I've also tried variations such as $mm and $month as well as putting them in quotes, etc, but to no avail. Has anyone else run into this?

-- LynnwoodBrown - 21 Feb 2005

Hmmmm, I was just trying this today and was going to ask the same question. It seems LynnwoodBrown beat me to it. I've looked at the code for the plugin and cannot see anywhere where it does this substitution. The https://twiki.org/p/pub/Plugins/CalendarPluginDevArchive/CalendarPlugin_V1.013_timedate.patch added this, but it was never merged into the mainline. It also uses $month and $year rather than $m and $y as the CalendarPlugin page says.

-- DavidBright - 01 Mar 2005

Just uploaded new CalendarPlugin.pm Version 1.015 - Added back support for preview showing unsaved events; Two loop fixes from DanielRohde. %SEARCH% works again when in current topic.

-- PatriceFournier - 03 Mar 2005

If I have events in a list in one web that reference topics in that web and then include that topic in a calendar on another web, I get unsatisfied references (i.e., the links show that the page does not exist). However, if I do %INCLUDE of that same event list, the references are properly qualified with the web name. Anyone know how we could get that behavior for the events in the calendar?

-- DavidBright - 09 Mar 2005

I've posted a complete package for this plugin incorporating the V1.015 changes as posted by PatriceFournier. Also, the up to date source is now in CVS.

-- DavidBright - 11 Mar 2005

I added "anniversaries" to the calendar plugin. This idea was proposed by MathiasKoerber on 30 Dec 2002 on this page. My implementation differs slightly from his, which proposed it to be an optional behavior for full dates. Since it is entirely possible to have an event that only occurs once, as well as those marked as anniversaries, it seemed to me that there needed to be some way to distinguish a single day event from an event that occured at some specific date but that we want to mark each year thereafter. So, the new version allows specifying such anniversary dates as:

   * A 20 Jul 1969 - First moon landing

For a calendar prior to that date, the event would not appear. For a calendar of July 1969, the event would appear as "First moon landing" on the 20th. For July calendars in subsequent years, it would appear as "First moon landing (x)", where x is the number of years since 1969 (e.g., for 1972, x would be "3"). At this point, I haven't made it possible to vary the formatting of the anniversary indicator, but that wouldn't be hard to do if there is demand for it. The new version, V1.016, is now uploaded to the CalendarPlugin page.

-- DavidBright - 12 Mar 2005

Our and my variables are not equivalent... the simple our to my change incorporated in 1.016 disabled (at least) the exception handling for recuring events.

-- PatriceFournier - 22 Mar 2005

embarrassment Sorry about that! I didn't stop to think about the differences. I will restore the our declarations and get exceptions working again.

-- DavidBright - 24 Mar 2005

Hi!

DavidBright and FranzJosefSilli sed to me to converge with the others Data and Time formating models becose the DateTimePlugin is a new variant to this, and it's no god...

So, I propose we set the default names in the topic ConvergeDateTimeFormattingModels and new ideas will have a place to be showed. (and will be easer to know wath is the default)

-- AurelioAHeckert - 31 Mar 2005

I attached a patch for CalendarPlugin v1.016:

  • added start and end date support for periodic repeaters
  • fixed exception handling (my > local)
  • integrated initlang patch by TWiki:Main.JensKloecker

I hope this patch will be incorporated into the next release (thanx in advance).

-- DanielRohde - 18 Apr 2005

According to the doco:

If an event falls in the selected month then the corresponding day is (by default):

  • highlighted (font size +2)
  • linked to the topic containing the event list
  • marked with an icon whose ALT string is the event's description
I've never seen it do this. I'm running Cairo and have updated to 1.016 of this plugin. The default behaviour is just plain text (ie not linked to the calendar entry page) in the calendar cell. The only way I could get it to do this was to set the FORMAT preference to
$old<br /><small>[[$web.$topic][$description]]</small>
Which worked, but this caused other troubles where the CALENDAR line was referencing more than one source topic containing events. The linked cell entries tried to link to a topic, the name of which was all the source topics concatenated, with a resulting ? on the link. So, from what I can work out, there are a couple of problems:
  1. The doco in CalendarPlugin isn't right about the default linking behaviour of cell contents.
  2. This functionality (or at least what I made happen by forcing it as above) looks like it clashes with the multiple topics thing.
Of course I could be missing something, but I've been messing around with this for a while now with no luck. Is it just me?

-- MarcusLeonard - 20 Apr 2005

Hi! I've released a new version of the CalendarPlugin. Also, the new source is in CVS.

The new release don't fix the bugs reported by TWiki:Main.MarcusLeonard. Take a look at CalendarPlugin topic for changes.

-- DanielRohde - 21 Jun 2005

Thanks Daniel. Since you are also the maintainer of the HolidaylistPlugin, how about taking the ownership of this Plugin as well by changing the policy to ContactAuthorFirst?

-- PeterThoeny - 25 Jun 2005

i didn't realise the ContactAuthorFirst field had anything to do with whether or not a plugin was maintained or "owned"; rather, i have always thought it was more of a reflection on the openness of the development process by the plugin author/maintainer. indeed, ContactAuthorFirst makes no such claims that a plugin not marked "Contact Author First" has been abandoned.

-- WillNorris - 26 Jun 2005

Will, all you say is correct. Ownership is may be too strong a word. This is a very essential Plugin (as measured by the TWikiMission), so it is in the interest of the community that this Plugin has a maintainer who is actively looking after it, hence ContactAuthorFirst.

-- PeterThoeny - 26 Jun 2005

yes, perhaps it is just "ownership" is too strong a word. i definitely agree with you that this is an essential plugin. perhaps we should simply add a "PluginMaintainer" field (in addition to the PluginAuthor) to the PackageForm (or as a field in the plugin table info on the plugin's topic itself)?

additionally, the timing for such an addition is good, as it will help assess which plugins will make the migration to DakarRelease.

-- WillNorris - 26 Jun 2005

I do not think a PluginMaintainer field is necessary since the last person in the "Plugin Author" table row implies who the maintainer is. (Discusssion on "Plugin migration to Dakar" is refactored out to PluginApiDiscussions)

BTW, this topic is getting very long. Older vetted feedback can be moved to the CalendarPluginDevArchive.

-- PeterThoeny - 29 Jun 2005

I can confirm the #MarcusLeonardBug, reported earlier. The CalendarPlugin was working for me on BeijingRelease, but after the upgrade to CairoRelease I find that repeating calendar entries are listed TWICE each day, and all calendar entries are in plain text. So something in Cairo seems to have munged up the calendar's behaviour.

-- KeithHelfrich - 03 Jul 2005

I added some code into the plugin to allow dates in the "business" format such as "Mon W40 2005" or "Thu Week 40 2005". The syntax "Week 50 2005" is also recognized (as "Mon W50 2005"). The new plugin file is attached below ( CalendarPluginBusiness.pm), the (few) modifications are signaled by REX comments. Maybe my code is not very elegant but I would be happy to have such feature added to the regular version of the plugin.

-- XavierREDON - 06 Jul 2005

I added some other features: the ability to process the final content of a cell and to set the color of a cell (in function of the cell content). That means two new parameters finalize and colorize. These parameters must be perl expressions that take the $content variable as input and return either the new content (for finalize) or the color of the cell (for colorize). In this way some "plugins" can be added to the CalendarPlugin taking form of small perl functions. For example my setting for the two parameters is :

      * Set FORMAT = $old<br>$description
      * Set FINALIZE = return smallText(mergeSessions(sortSessions($content)))
      * Set COLORIZE = return detectCollisions($content)
I use this to handle in a better way the events with a session time prefix (such as 8h-10h: trying to wake up). One of the function sort the sessions according to the time, another merge sessions with same time period and the last function detect if two sessions overlap (and set the cell color to red). The new plugin file is attached below ( CalendarPluginModules.pm), the modifications are signaled by REX comments.

-- XavierREDON - 09 Jul 2005

Hi Xavier! What do you think about security? You can define a FINALIZE or COLORIZE like this (or a function call that do the same):

   * Set FINALIZE = print `cat /etc/passwd`;

It is a nice idea to extend this plugin but your changes allow execution of (bad) perl code. You must check a option that is evaluated by a 'eval' statement to prevent malicious code execution.

-- DanielRohde - 18 Jul 2005

Who's maintaining this plugin? Why did BradDixons very useful enhancement from 14 Apr 2004 never make it into a released version? What about the performance issues mentioned once and awhile, doesn't this conceptually exeptional plugin get used out there? I'd like to see the HolidaylistPlugin merged back into the CalendarPlugin cause holidays are just a special subset of events.

-- FranzJosefSilli - 29 Aug 2005

I work on this plugin when I have time. Unfortunately, my time has been very limited this summer. I am, however, currently working on enhancements to allow displaying more than one month at a time and to display "Upcoming events" in a list format. I hope to commit that change soon.

I, too, would like to see event time added to this plugin (I presume that is the patch to which you refer), but I think it should apply to more types of events than the current patch allows.

-- DavidBright - 31 Aug 2005

The bug reported by MarcusLeonard about the "default" format is caused by the fact that the CalendarPlugin topic distributed with the plugin contains a =   * Set FORMAT === which overrides the default format. I plan on changing that in the next version.

-- DavidBright - 16 Sep 2005

Before I upload my new version of the CalendarPlugin, here is my idea:

  • Add a "months=n" parameter for displaying n months of calendars. For example, %CALENDAR{month="9" year="2005" months="2"}% would display a calendar for September 2005 and another for October 2005. The default would me months="1" to maintain current behavior.
  • Add as "aslist=1" parameter to cause the events from the calendar to be displayed in a list form, rather than the traditional table format. Specifying "aslist=0" (the default) would render the calendar in the table format.
  • Add a "days=n" parameter. This would specify the number of days of events to display when "aslist=1". It is ignored for a table-format calendar display. If the starting month for the list is the current month, than the starting day is the current day. If the starting month for the list is not the current month, then the starting day is the first of that month. For example, if I render %CALENDAR{aslist="1" month="9" days="10"}% on September 15, the list would display events occuring during the period of September 15-24, inclusive. If I were to render %CALENDAR{aslist="1" month="9" days="10"}% on August 1, it would display events occuring during the period of September 1-10, inclusive.
  • Add a "datenumberformat=fmt" parameter. Here, fmt specifies how to mark the day on the calendar. It can be any arbitrary text and can contain the same substitutable parameters as %GMTIME{"fmt"}% takes (see GMTIME). This can be very useful for an "aslist=1" display so that both the month and day can be rendered. Note that there is no way currently defined to specify a time for an event, so if a time display specication is in fmt, it will be displayed as 00:00:00 (midnight). The default datenumberformat is "$day" (i.e., just the day number within the month).
  • Add a "todaydatenumberformat=fmt" parameter. This specifies how to display today's date. The meaning of the fmt argument is exactly as described above for the "datenumberformat" parameter.
  • Add a "multidayformat=fmts" parameter.
The multidayformat option allows the description of each day of a multiday event to be displayed differently. This could be used to visually or textually annotate the description to indicate continuance from or to other days.

The option consists of a comma separated list of formats for each type of day in a multiday event:

first, middle, last, middle-unseen, last-unseen

Where:

first is the format used when the first day of the event is displayed

middle is the format used when the day being displayed is not the first or last day

last is the format used when the last day of the event is displayed

middle-unseen is the format used when the day being displayed is not the first or last day of the event, but the preceding days of the event have not been displayed. For example, if an event runs from 29 Apr to 2 May and a May calendar is being displayed, then this format would be used for 1 May.

last-unseen is the format used when the day being displayed is the last day of the event, but the preceding days of the event have not been displayed. For example, if an event runs from 29 Apr to 1 May and a May calendar is being displayed, then this format would be used for 1 May. Note that in the previous example (event from 29 Apr to 2 May), this format would not be used for a May calendar because the event was "seen" on 1 May; so, the last format would be used for 2 May.

The formats can be as described for GMTIME. However, in order to allow rendering both the beginning and ending dates of the event, the format options must be surrounded in $first() (for the beginning date) or $last() (for the ending date). Note that the format cannot have any embedded closing parenthesis characters; if you need that, encode it as an HTML entity. For example, a format of "from $first($day $mon) to $last($day $mon)" would display "from 9 Sep to 11 Sep" for an event that occurs on September 9, 10, and 11.

Missing formats will be filled in as follows:

  • middle will be set to first
  • last will be set to middle
  • middle-unseen will be set to middle
  • last-unseen will be set to last

Missing formats are different from empty formats. For example, multidayformat="$description (until $last($day $month)),,": specifies an empty format for middle and last. The result of this is that only the first day will be shown. Note that since an unspecified middle-unseen is set from the (empty) middle format, an event that begins prior to the calendar being displayed but ending in the current calendar will not be displayed. In contrast, multidayformat="$description" will simply display the description for each day of the event; all days (within the scope of the calendar) will be displayed.

The default format is to simply display the description of the event.

If anyone has strong opinions about the parameter names and/or behavior, please chime in. I can still tweak this before checking in. Also, if the explanation of the above isn't clear, I'd be happy to have suggestions on making it more so.

-- DavidBright - 16 Sep 2005

Sounds complicated, but all enhancements are most welcome, as long as they actually enhance. wink

-- FranzJosefSilli - 16 Sep 2005

David, those enhancements look good, especially the listing of upcoming events. Your proposed changes above would make the plugin pretty clever. About the only other thing missing would be notification of upcoming events - or am I just getting greedy? smile

-- MarcusLeonard - 27 Oct 2005

One possibility for that in incorporating the code from MailReminderPlugin (which probably really should have added notification feature to CalendarPlugin in the first place). Incidentally, I just happened to try out MailReminderPlugin on Dakar today and it failed horribly. It made WebPreferences topic fail to load.

-- LynnwoodBrown - 27 Oct 2005

As far as I can make out, the alist option does't display anything in a reaonable format. I was expecting something like a page out of a month-by-month disary. This is what I got

  • ISW18.png:
    ISW18.png

-- AntonAylward - 03 Nov 2005

I've tracked down that bug.
In the asList processing there are two problems;

  • The $cal->getcontent($day) is not followed by a line break or horizontal like, so the entries all run into one another
  • The "double date numbers", or more accurately double formatted date, is because the loop in the asList processing duplicates the formatting that had already been done earlier in the same subroutine (sub handleCalendar() around lines 467 to 478).

  • Calendar_aslist.diff: Here is the diff showing the change in aslist processing to eliminate duplicate days

-- AntonAylward - 04 Nov 2005

Thanks, Anton, for pointing that out. I took a different approach to fixing it. The list by default now has entries for each event that look like:

  • 01 Jan 2006 - New Year's Day
There is some confusing interaction between the plugin and HTML::Calendar in terms of who displays the date number that is easy to miss. In my test environment I had worked around the issue a long time ago and had forgotten that I was using a workaround. Nothing like giving someone else a chance at your code for pointing out all the things you failed to consider.

By the way, in case anyone wonders what we're talking about, this little thread deals with the still unreleased next version of the plugin. I hope to have it posted to the Plugins web soon (but I've said that before...).

-- DavidBright - 04 Nov 2005

There is one inherent shortcoming of this plugin, and it is a very simple one.

Its best demomstrated by a trivial example:

%~~ CALENDAR{  
~~~  month="11" aslist="1" 
~~~ }%

   * 01 Nov - First of November
   * 02 Nov - Second of November
   * 03 Nov - Third of November
You get the same list over again but with hyperlinks ... to the same topic.

You may not think this a good example of the problem, but consider if I had a full years items in another topic. The links would only take me to that topic, it won't take me to the item itself.

So we break that up into months and use the topic="Web.TopicName1, TopicName2" syntax to collect all the months. No, that doens't solve the problem, it only slices and dices it.

Why do I say that? Two reasons.

  1. In reality the 'data' files need to be readable, so they are not bullet lists. The bullet lists have to be generated by a SEARCH on the real data files.
  2. The real data files may contain many hundred of items for each month. They may be automatically generated from external data sources. They will most certainly contain more detailed information. The topics they are in must be readbale and manageable in their own context.

Here is a short example:

---++ September 

---+++ IBS - Jahresfachkonferenz SAP R/3-Security Auditing 
*WHERE*: Hamburg, Germany %BR%
*WHEN*: Sept 29-30 %BR%
www.ibs-hamburg.de %BR%
The brochure is in German, so the conference might be as well.

---+++ Cell Seizure Forensic Course
*WHEN*: Sep 01-02 %BR%
*WHERE*: Monterey, CA %BR% http://www.paraben-training.com/celldetails.html

---+++ EnCase Intermediate Analysis and Reporting
*WHEN*: Sep 06-09 %BR%
*WHERE*: Houston, TX %BR% http://www.encase.com/training/LawEnforcement/course2.asp

---+++ EnCase Field Intelligence Model, Live Forensic Investigations
*WHEN*: Sep 06-09 %BR%
*WHERE*: Austin, TX %BR% http://www.encase.com/training/LawEnforcement/course5.asp

---+++ EnCase Advanced Internet Examinations
*WHEN*: Sep 06-09 %BR%
*WHERE*: Liverpool, England
%BR% http://www.encase.com/training/Expert/course1.asp
These are automatically generated from a feed and there are between 80 and 300 a month. Without some kind of ability to jump to the relevant entry, this is just to awkward to use.

I compare this with some sites that are using a PHP calendar and I'm disapointed in TWiki.

As PeterThoeny says, this component is a key part of the TWikiMission, but its awkward (e.g. it uses a date format different from other components so can't share code), and is heavy on features (cell colourization etc) at the expense of the kind of functionality I'm talking about here.

Would it help if the pattern was configurable - those heading markers rather than bullets? No, I don't think so.

-- AntonAylward - 04 Nov 2005

Has anyone written a %COMMENT template (possibly using JSCalendarContrib) for generating bullet items suitable for CalendarPlugin to digest?

-- AntonAylward - 04 Nov 2005

I'd agree that the default of linking to the calendar topic is not useful. I retained that from the original default. I'd be more than happy to change it (or see it changed) to something better, if such a thing could be found.

If this plugin is not meeting the needs of users, then we should fix (or re-implement) it so that it does. I'm open to suggestions, requirements, pointers to good alternative calendars, etc.

I've thought about the %COMMENT% template, but haven't done anything about it (yet).

-- DavidBright - 07 Nov 2005

Back in 2004 someone asked the question about grid lines not showing up during print or print previews accross all browsers. Being new to TWIKI and ths plugin I would like to know how to fix this issue, cause it's very hard to read on paper.

Also to answer a question regarding installation of CPAN somewhere's above. use putty to connect and type [perl -MCPAN -e 'install {filename}'] good luck.

-- EdwardCoker - 22 Dec 2005

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch CalendarPlugin.htmlarea.patch r1 manage 1.6 K 2004-09-19 - 17:32 UnknownUser Allows the CalendarPlugin to work on wikis using htmlarea.
Perl source code filepm CalendarPlugin.pm r5 r4 r3 r2 r1 manage 20.5 K 2005-03-03 - 17:51 UnknownUser Version 1.015 - Added back support for preview showing unsaved events; Two loop fixes from DanielRohde; this has been incorporated into a package posted to CalendarPlugin topic.
Perl source code filepm CalendarPlugin1.pm r10 r9 r8 r7 r6 manage 12.9 K 2002-12-20 - 15:38 UnknownUser improved module loading in exception functions
Perl source code filepm CalendarPluginBusiness.pm r1 manage 24.2 K 2005-07-06 - 17:04 UnknownUser Calendar plugin with business date syntax
Perl source code filepm CalendarPluginModules.pm r1 manage 28.1 K 2005-07-09 - 09:22 UnknownUser  
Perl source code filepm CalendarPlugin_1010_RB.pm r1 manage 15.6 K 2003-05-29 - 09:08 UnknownUser Version 1.010 with RB changes
Perl source code filepm CalendarPlugin_RB.pm r1 manage 16.4 K 2003-05-27 - 13:39 UnknownUser  
Unknown file formatpatch CalendarPlugin_V1.013_initlang.patch r1 manage 1.6 K 2004-04-30 - 06:52 UnknownUser Fixes initialization of the LANG attribute from the CalendarPlugin topic
Unknown file formatpatch CalendarPlugin_V1.013_timedate.patch r2 r1 manage 8.9 K 2004-04-19 - 15:34 UnknownUser Adds time event parsing
Unknown file formatpatch CalendarPlugin_V1.016_excl.patch r1 manage 5.5 K 2005-04-18 - 08:00 UnknownUser fixed exception handling (my->local); added start and date support for periodic repeaters; lang patch from TWiki:Main.JensKloecker
Unknown file formatpatch CalendarPlugin_line522.patch r1 manage 0.8 K 2004-04-23 - 20:46 UnknownUser fixes Odd number of elements in hash assignment at .. line 522; this problem has been fixed in V1.015 of the plugin.
Unknown file formatdiff Calendar_aslist.diff r1 manage 2.1 K 2005-11-04 - 12:34 UnknownUser Cahnge in aslist processing to eliminate duplicate days
Unknown file formatpatch DayHeadings.patch r1 manage 1.6 K 2002-12-25 - 06:59 UnknownUser Add daynames attribute.
PNGpng ISW18.png r1 manage 106.4 K 2005-11-03 - 23:36 UnknownUser  
Unknown file formatpatch Lug-JulFix.patch r1 manage 2.5 K 2002-05-18 - 18:02 UnknownUser Fixes references to "Lug" to be "Jul" for July.
Unknown file formatext WikiCalendar2alarm r2 r1 manage 7.1 K 2004-12-14 - 19:45 UnknownUser Schedule a local alarm based on a wiki calendar
JPEGjpg black_cal.jpg r1 manage 23.8 K 2003-05-29 - 10:52 UnknownUser problems with Dan's CalendarPlugin_1010_RB.pm
Unknown file formatpatch calendarplugin_odd_hash.patch r1 manage 2.8 K 2004-11-04 - 18:43 UnknownUser Runs under 5.005_03: s/our/my/, and getTopicText() takes %options arg as a reference.; getTopicText() was changed in V1.015 to eliminate the odd hash warnings
Unknown file formatpatch lang.patch r2 r1 manage 1.0 K 2003-05-07 - 07:50 UnknownUser Add "lang" attribute
JPEGjpg not-sized-properly.jpg r1 manage 67.2 K 2004-03-13 - 22:18 UnknownUser  
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2006-06-14 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.