<img alt="example" src="%ATTACHURL%/Example.jpg" /> ---+!! <nop>%TOPIC% This plugin is originally build on CalendarPlugin v1.020 . The CalendarPlugin2 handles the tag *%CALENDAR2%* that inserts a monthly calendar in the page. Multiple topics can be specified as the source of the events, and these can be in any web. The calendar marks dates corresponding to the events. If you dont want to use tag *%CALENDAR2%*, you can modify it in <nop>CalendarPlugin.pm at line 267,268 and also in <nop>CalSync.pm 121,122. NB. This Plugin does not, and has never, observed topic permissions. %TOC% ---++ Syntax Rules | *You type* | *you get* | | %<nop>CALENDAR2% | a monthly calendar for the current month/year, with events taken from the current topic | | %<nop>CALENDAR2{<attributes>}% | is the full syntax | * * ---+++ Attributes recognized | *Attribute* | *Meaning* | *Default* | | ==oldcalendar="1" or "0"== | if 1 calendar looks like CalendarPlugin v1.020 | "0" | | ==id="any"== | identify particular iCal Calendar if there is more than one Calendar in the same topic | "" | | ==timezone="+/-hh" or a time zone abbreviation (e.g. "UTC", "CET" ...)== | specify timezone, ! NOT WORKING PROPERLY ! | "0" | | ==year="yyyy"== | The year | Current year | | ==year="+yy"== or =="-yy"== | Relative year | Current year | | ==month="mm"== | The month | Current month | | ==month="+mm"== or =="-mm"== | relative month | Current month | | ==topic="TopicName"== | Topic containing events | The topic containing the tag | | ==topic="Web.TopicName1, <nop>Web.TopicName2"== | Topics containing events | The topics containing the tags | | ==web="Webname"== | Web containing the event topic | The current web | | ==lang="language"== | Language: First few characters of "English", "Frani"?1/2ais", "Deutsch", "Espai"?1/2ol", "Portugui"?1/2s", "Nederlands", "Italiano", "Norsk", "Svenska", "Dansk", "suomi", "Magyar", "Polski | "English" | | ==daynames="Mon?Tue?..."== | Custom day names | "Monday?Tuesday?Wednesday?Thursday?<br />Friday?Saturday?Sunday" | | ==header="..."== | Text at the top of the calendar; use ==$m== for current month, ==$y== for year | Current month and year - only in oldcalendar | | ==weekstartsonmonday="1"== or =="0"== | Flag to start week on Monday | "0" (Sunday) | | ==showdatenumbers="0"== | Show day numbers 1...31 in date cells. Note that ==showdatenumbers=1== means that ==HTML::CalendarMonthSimple== will add the date numbers to the cells. If ==showdatenumbers=0==, then the plugin adds the date numbers. The result of this is that a calendar will *always* show the date numbers. | "0" (except with aslist="1", see below) - only in oldcalendar | | ==showweekdayheaders="1"== | Show the weekday headers | "0" - only in oldcalendar | | ==weekdayheadersbig="0"== | If enabled, show weekday headers in bold cell headings | "1" - only in oldcalendar | | ==cellalignment="left"== | Horizontal cell alignment of day cells: "left", "center", "right", "justify", "char" | "center" - only in oldcalendar | | ==vcellalignment="middle"== | Vertical cell alignment of day cells: "top", "middle", "bottom", "baseline" | "top" - only in oldcalendar | | ==cellheight="n"== | Height in pixels of each cell in the calendar | Minimum height needed - only in oldcalendar | | ==format="..."== | How to highlight a date | See [[%TOPIC%#EventFormatting][Event Formatting]] below - only in oldcalendar | | ==width="n"== or =="n%"== | Width of calendar table in pixels or percent | Minimum width needed | | ==border="n"== | Border width of calendar table | "1" - only in oldcalendar | | ==nowrap="1"== or =="0"== | Prevent cell content from wrapping | "0" - only in oldcalendar | | ==bgcolor="#nnnn"== | Default background color of all cells unless redefined by other color settings below (use an HTML color-code like "#000000" as defined in %TWIKIWEB%.StandardColors) | white - only in oldcalendar | | ==contentcolor="#nnnn"== | Default content color of all cells unless redefined | black - only in oldcalendar | | ==headercolor="#nnnn"== | Background color of the Month+Year header | The web bgcolor - only in oldcalendar | | ==headercontentcolor="#nnnn"== | Content color of the Month+Year header | contentcolor setting - only in oldcalendar | | ==weekdayheadercolor="#nnnn"== | Background color of weekdays' headers | bgcolor setting - only in oldcalendar | | ==weekdayheadercontentcolor=<br /> "#nnnn"== | Content color of weekdays' headers | contentcolor setting - only in oldcalendar | | ==weekendheadercolor="#nnnn"== | Background color of weekends' headers | bgcolor setting - only in oldcalendar | | ==weekendheadercontentcolor=<br /> "#nnnn"== | Content color of weekends' headers | contentcolor setting - only in oldcalendar | | ==weekdaycolor="#nnnn"== | Background color of weekday cells | bgcolor setting - only in oldcalendar | | ==weekdaycontentcolor="#nnnn"== | Content color of weekday cells | contentcolor setting - only in oldcalendar | | ==weekendcolor="#nnnn"== | Background of weekend cells | light gray - only in oldcalendar | | ==weekendcontentcolor="#nnnn"== | Content color of weekend cells | contentcolor setting - only in oldcalendar | | ==todaycolor="#nnnn"== | Background of today's cell | The web bgcolor - only in oldcalendar | | ==todaycontentcolor="#nnnn"== | Content color of today's cell | contentcolor setting - only in oldcalendar | | and other attributes of HTML::CalendarMonthSimple ||| | ==aslist== | Controls whether events displayed in calendar style ( =aslist=0=) or list style ( =aslist=1=). Note that specifying =aslist=1= forces =showdatenumbers=1=. This is done to ensure that the date number is formatted according to =datenumberformat= and that only the days that have an event are listed. | 0 - only in oldcalendar | | ==days== | Specifies how many days of calendar data to list. Only valid if =aslist=1=. | 1 | | ==months== | Specifies how many months of calendars to display. Only valid if =aslist=0=. | 1 | | ==datenumberformat== | Specifies formatting for the date number in each cell. The formatting codes accepted are the same as those for the ==%<nop>GMTIME%== variable. | '$day' (if =aslist=0=)%BR%' * $day $mon $year' (if =aslist=1=) - only in oldcalendar | | ==todaydatenumberformat== | Specifies formatting for the date number for the current day (today) in the calendar. The formatting codes accepted are the same as those for the ==%<nop>GMTIME%== variable. | ==datenumberformat== - only in oldcalendar | | ==multidayformat== | Specifies formatting of the description for multi-day events. See [[%TOPIC%#MultiDayFormatting][Multi-Day Event Formatting]] for details. | ==$description== - only in oldcalendar | ---+++ Event Syntax Events are defined by bullets with the following syntax: | *Event type* | *Syntax* | *Example* | | *Single*: | ==* dd MMM yyyy - description== | 09 Dec 2002 - Expo | | *Single incuding time*: | ==* dd MMM yyyy hh:mm(:ss) - hh:mm(:ss) - description== | 09 Dec 2002 14:00(:00)-15:00(:00) - Expo (Same day) | | ^ | ==* dd MMM yyyy hh:mm(:ss) - description== | 09 Dec 2002 14:00(:00) - Expo (from 14 to the end of the day) | | *Interval*: | ==* dd MMM yyyy - dd MMM yyyy - description== | 02 Feb 2002 - 04 Feb 2002 - Vacation | | *Interval including time*: | ==* dd MMM yyyy hh:mm(:ss) - dd MMM yyyy hh:mm(:ss) - description== | 02 Feb 2002 14:00(:00) - 04 Feb 2002 14:00(:00) - Vacation | | *Yearly*: | ==* dd MMM - description== | 05 Jun - Every 5th of June | | ^ | ==* w DDD MMM - description== | 2 Tue Mar - Every 2nd Tuesday of March | | ^ | ==* L DDD MMM - description== | L Mon May - The last Monday of May | | ^ | ==* A dd MMM yyyy - description== | A 20 Jul 1969 - First moon landing%BR%This style will mark anniversaries of an event that occurred on the given date. The description will have " (x)" appended to it, where "x" indicates how many years since the occurence of the first date. The first date is not annotated. | | *Monthly*: | ==* w DDD - description== | 1 Fri - Every 1st Friday of the month | | ^ | ==* L DDD - description== | L Mon - The last Monday of each month | | ^ | ==* dd - description== | 14 - The 14th of every month | | *Monthly including time*: | ==* w DDD hh:mm(:ss) - hh:mm(:ss) - description== | 1 Fri 14:00(:00) - 15:00(:00) - Every 1st Friday of the month from 14:00 to 15:00 | | ^ | ==* L DDD hh:mm(:ss) - hh:mm(:ss) - description== | L Mon 14:00(:00) - 15:00(:00) - The last Monday of each month from 14:00 to 15:00 | | ^ | ==* dd hh:mm(:ss) - hh:mm(:ss) - description== | 14 14:00(:00) - 15:00(:00) - The 14th of every month from 14:00 to 15:00 | | *Weekly*: | ==* E DDD - description== | E Wed - Every Wednesday | | ^ | ==* E DDD dd MMM yyyy - description== | E Wed 27 Jan 2005 - Every Wednesday Starting 27 Jan 2005 | | ^ | ==* E DDD dd MMM yyyy - dd MMM yyyy - description== | E Wed 1 Jan 2005 - 27 Jan 2005 - Every Wednesday from 1 Jan 2005 through 27 Jan 2005 (inclusive) | | *Weekly including time*: | ==* E DDD hh:mm(:ss) - hh:mm(:ss) - description== | E Wed 14:00 - 15:00 - Every Wednesday 14:00 - 15:00 | | ^ | ==* E DDD hh:mm(:ss) - hh:mm(:ss) dd MMM yyyy - description== | E Wed 14:00 - 15:00 1 Jan 2005- Every Wednesday 14:00 - 15:00 Starting 27 Jan 2005 | | ^ | ==* E DDD hh:mm(:ss) - hh:mm(:ss) dd MMM yyyy - dd MMM yyyy - description== | E Wed 14:00 - 15:00 1 Jan 2005 - 27 Jan 2005 - Every Wednesday from 1 Jan 2005 through 27 Jan 2005 (inclusive) | | *Periodic*: | ==* En dd MMM yyyy - description== | E3 02 Dec 2002 - Every three days starting 02 Dec 2002 | | ^ | ==* En dd MMM yyyy - dd MMM yyyy - description== | E3 12 Apr 2005 - 31 Dec 2005 - Every three days from 12 Apr 2005 through 31 Dec 2005 (inclusive) | | *Exception*: | Insert the following between the above syntax and the description:<br /> ==X { dd MMM yyyy, dd MMM yyyy - dd MMM yyyy }== | 1 Fri X { 01 Dec 2002, 06 Dec 2002 - 14 Dec 2002 } - Every first Friday except on the 01 Dec 2002 and between 06 Dec 2002 and 14 Dec 2002 | #ExportToICal ---+++ Export to iCal Every %<nop>CALENDAR2% tag creates also iCalendar export of Events, it is available through direct link placed under Calendar. If you want to have your organiser synchronized, you can use this link. ICal files are by default saved in pub directory. #EventFormatting ---+++ Event formatting For a table-style calendar, each day which has one or more events will have a list of the descriptions of those events. Each event description will be set in a small font. In other words, ==format== is: <verbatim> $old<br /><small>$description</small> </verbatim> For a list-style calendar, if an event falls in the selected time period, then it is displayed (by default) as a bullet item with the date as dd Mmm yyyy In other words, ==datenumberformat== is: <verbatim> * $day $mon $year </verbatim> and ==format== is: <verbatim> $old - $description </verbatim> This displays the events in a form very similar to that in which they are specified (although specific to a particular date). #MultiDayFormatting ---+++ Multi-Day Event Formatting only with attribute oldcalendar="1" 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. Within each format, date information for the current day can be substituted using the same format codes as accepted by =%<nop>GMTIME%=. An extension to these codes allows the date of the first and/or last day of the event to also be rendered. * =$first( _format_)= will render the first date of the event according to _format_, where _format_ is, again, a string of codes acceptable to =%<nop>GMTIME%=. * =$last( _format_)= will render the last date of the event in the way just described for =$first()= 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. ---++ Examples <table width="80%" border="1"> <tbody><tr><th>You type:</th><th>You get:</th><th>If correctly installed:</th></tr> <tr><td> A list of Events is just a bullet list like this: * 2 Feb - Andrea's birthday * A 7 Mar 1966 - Nicoletta's birthday * 29 May 1996 - Maria Teresa is born! * 29 Sep 1998 - Davide is born! %<nop>CALENDAR2{ oldcalendar="1" month="2" year="2002" bgcolor="cyan"}% %<nop>CALENDAR2{month="3" year="2002" showweekdayheaders="1" ID="1"}% </td><td align="center"> <!-- First calendar --> <table width="0" cellspacing="0" cellpadding="0" border="0"> <tbody><tr align="left" valign="top"> <td align="left" bgcolor="black" valign="top"><table width="100%" cellspacing="1" cellpadding="3" border="0"><tbody><tr><td colspan="7" bgcolor="#ffd8aa"><font size="+2">February 2002</font></td></tr> <tr> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center"> </td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center"> </td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center"> </td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center"> </td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center"> </td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">01</td> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center">02<br />Andrea's birthday</td> </tr> <tr> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center">03</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">04</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">05</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">06</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">07</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">08</td> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center">09</td> </tr> <tr> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center">10</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">11</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">12</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">13</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">14</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">15</td> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center">16</td> </tr> <tr> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center">17</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">18</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">19</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">20</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">21</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">22</td> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center">23</td> </tr> <tr> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center">24</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">25</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">26</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">27</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center">28</td> <td width="14" bordercolor="black" align="center" bgcolor="cyan" valign="center"> </td> <td width="14" bordercolor="black" align="center" bgcolor="lightgrey" valign="center"> </td> </tr> </tbody></table> </td> </tr> </tbody></table> <!-- Second calendar --> <img width="400" alt="Example" src="%ATTACHURL%/Example.JPG" height="242" /> <!-- End of calendars --> </td><td align="center"> <!-- First calendar --> %CALENDAR2{oldcalendar="1" month="2" year="2002" bgcolor="cyan" ID="1"}% <!-- Second calendar --> %CALENDAR2{month="3" year="2002" showweekdayheaders="1" ID="1"}% <!-- End of calendars --> </td></tr> </tbody></table> ---++ Plugin Settings Plugin settings are stored as preferences variables. To reference a plugin setting write ==%<nop><plugin>_<setting>%==, i.e. ==%<nop>INTERWIKIPLUGIN_SHORTDESCRIPTION%== * One line description, is shown in the %TWIKIWEB%.TextFormattingRules topic: * Set SHORTDESCRIPTION = Show a monthly calendar with highlighted events * Debug plugin: (See output in =data/debug.txt=) * Set DEBUG = 0 * How the cell content is formatted <verbatim> * #Set FORMAT = $old<br /><small>$description</small> </verbatim> * __Note:__ You can add settings of any of the recognized attributes (in upper case like SHOWWEEKDAYHEADERS). Examples are shown below: * #Set CELLALIGNMENT = center * #Set VCELLALIGNMENT = center * #Set WIDTH = 100% * #Set GMTOFFSET = +10 * #Set SHOWWEEKDAYHEADERS = 0 * #Set WEEKSTARTSONMONDAY = 0 ---++ Plugin Installation Instructions __Note:__ You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running. * Download the ZIP file from the Plugin web (see below) * The Plugin uses the ==HTML::CalendarMonthSimple2== and ==HTML::CalendarMonthSimple== and ==Date::Calc== *,* ==Date::ICal== *,* ==Data::== ==ICal== *CPAN* packages (see http://www.cpan.org) * Install ==Date::Calc== * Install ==Date::ICal== * Install ==Data::== ==ICal== * Install ==HTML::CalendarMonthSimple2== and ==HTML::CalendarMonthSimple== * To avoid an annoying log message, change line 272 of <nop>CalendarMonthSimple.pm v1.25 by adding the section marked in %RED% RED %ENDCOLOR% :<br /> <verbatim>if ($self->year = = $todayyear && $self->month = = $todaymonth %RED% && defined $thisday %ENDCOLOR% && $thisday = = $todaydate)</verbatim> * For earlier or later versions where the line number may be different, search for =todayyear=. It currently (v1.22-v1.25) only appears twice: once to declare and set it, once to use it. On the line that uses it, add the =%RED%&& defined $thisday%ENDCOLOR%= as shown above. -- TWiki:Main.AngusRogerson - 16 Aug 2004 * Unzip ==CalendarPlugin.zip== in your twiki installation directory. Content: | *File:* | *Description:* | | ==data/TWiki/CalendarPlugin.txt== | Plugin topic | | ==data/TWiki/CalendarPlugin.txt,v== | Plugin topic repository | | ==lib/TWiki/Plugins/CalendarPlugin.pm== | Plugin Perl module | | ==pub/TWiki/CalendarPlugin/exclam.gif== | Image file | | ==pub/TWiki/CalendarPlugin/ICal.gif== | Image file | | ==bin/getical== | Sync script | | ==lib/TWiki/Contrib/CalSync.pm== | Perl module | | ==lib/HTML/Bubble.js== | JavaScript displays event details in bubble | | ==lib/HTML/Cal.css== | GoogleCalendar-like css | | ==lib/HTML/CalendarMonthSimple.pm== | Plugin Perl module | | ==lib/HTML/CalendarMonthSimple2.pm== | Plugin Perl module | | ==lib/HTML/images/btn_next.gif== | Button image | | ==lib/HTML/images/btn_prev.gif== | Button image | | ==lib/HTML/images/continue.gif== | previous line in calendar | | ==lib/HTML/images/bubble.png== | Bubble image | * (Dakar) Visit =configure= in your TWiki installation, and enable the plugin in the {Plugins} section. * Test if the installation was successful: * You should see two calendars near the Event list above and a current month calendar below: %<nop>CALENDAR2% ---++ Plugin Info | Plugin Author: | TWiki:Main/PavelJenicek | | Copyright: | © 2010, TWiki:Main/PavelJenicek | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | | Plugin Version: | 2010-01-21 (V1.000) | | Change History: | <!-- versions below in reverse order --> | | 2010-01-21: | Initial version | | TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 | | CPAN Dependencies: | CPAN:HTML::CalendarMonthSimple2 or CPAN:HTML::CalendarMonthSimple >= v1.23, CPAN:Date::Calc, CPAN:Date::ICal, CPAN:Data::ICal | | Other Dependencies: | none | | Perl Version: | 5.005 | | [[TWiki:Plugins/Benchmark][Benchmarks]]: | %SYSTEMWEB%.GoodStyle nn%, %SYSTEMWEB%.FormattedSearch nn%, %TOPIC% nn% | | Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | | Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal | __Related Topics:__ %SYSTEMWEB%.TWikiPlugins, %SYSTEMWEB%.DeveloperDocumentationCategory, %SYSTEMWEB%.AdminDocumentationCategory, %SYSTEMWEB%.TWikiPreferences
This topic: TWiki
>
CalendarPlugin
Topic revision: r1 - 2019-10-14 - TWikiGuest
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback
Note:
Please contribute updates to this topic on TWiki.org at
TWiki:TWiki.CalendarPlugin
.