%CALENDAR%
variable which 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.
Note: This Plugin does not observe topic permissions.
You type | you get |
---|---|
%CALENDAR% |
a monthly calendar for the current month/year, with events taken from the current topic |
%CALENDAR{<attributes>}% |
is the full syntax |
Parameter | Description | Default |
---|---|---|
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 |
gmtoffset="+/-hh" |
Timezone expressed as number of hours offset from GMT | Server timezone |
topic="TopicName" |
Topic containing events | The topic containing the tag |
topic="Web.TopicName1, 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", "Francais", "Deutsch", "Espagnol", "Portugues", "Nederlands", "Italiano", "Norsk", "Svenska", "Dansk", "Suomi", "Magyar", "Polski | "English" |
daynames="Mon|Tue|..." |
Custom day names | "Monday|Tuesday| |
header="..." |
Text at the top of the calendar; use $m for current month, $y for year |
Current month and year |
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) |
showweekdayheaders="1" |
Show the weekday headers | "0" |
weekdayheadersbig="0" |
If enabled, show weekday headers in bold cell headings | "1" |
cellalignment="left" |
Horizontal cell alignment of day cells: "left", "center", "right", "justify", "char" | "center" |
vcellalignment="middle" |
Vertical cell alignment of day cells: "top", "middle", "bottom", "baseline" | "top" |
cellheight="n" |
Height in pixels of each cell in the calendar | Minimum height needed |
format="..." |
How to highlight a date | See Event Formatting below |
width="n" or "n%" |
Width of calendar table in pixels or percent | Minimum width needed |
sharpborders="n" |
If set to 1, this gives very crisp edges between the table cells. If set to 0 standard HTML cells are used. | "1" |
border="n" |
Border width of calendar table. (sharpborders="0" required) | "1" |
cellspacing="n" |
Spacing of calendar cells. (sharpborders="0" required) | "0" |
cellpadding="n" |
Padding of calendar cells. (sharpborders="0" required) | "3" |
nowrap="1" or "0" |
Prevent cell content from wrapping | "0" |
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 StandardColors) | "white" |
contentcolor="#nnnn" |
Default content color of all cells unless redefined | "black" |
headercolor="#nnnn" |
Background color of the Month+Year header | The web bgcolor |
headercontentcolor="#nnnn" |
Content color of the Month+Year header | contentcolor setting |
weekdayheadercolor="#nnnn" |
Background color of weekdays' headers | bgcolor setting |
weekdayheadercontentcolor= |
Content color of weekdays' headers | contentcolor setting |
weekendheadercolor="#nnnn" |
Background color of weekends' headers | bgcolor setting |
weekendheadercontentcolor= |
Content color of weekends' headers | contentcolor setting |
weekdaycolor="#nnnn" |
Background color of weekday cells | bgcolor setting |
weekdaycontentcolor="#nnnn" |
Content color of weekday cells | contentcolor setting |
weekendcolor="#nnnn" |
Background of weekend cells | light gray |
weekendcontentcolor="#nnnn" |
Content color of weekend cells | contentcolor setting |
todaycolor="#nnnn" |
Background of today's cell | The web bgcolor |
todaycontentcolor="#nnnn" |
Content color of today's cell | contentcolor setting |
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" |
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 %GMTIME% variable. |
$day (if aslist="0" ) * $day $mon $year (if aslist="1" ) |
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 %GMTIME% variable. |
datenumberformat |
multidayformat |
Specifies formatting of the description for multi-day events. See Multi-Day Event Formatting for details. | $description |
Event type | Syntax | Example |
---|---|---|
Single: | * yyyy-mm-dd - description |
2002-12-09 - Expo ISO island |
* dd MMM yyyy - description |
09 Dec 2002 - Expo | |
Interval: | * yyyy-mm-dd - yyyy-mm-dd - description |
2002-02-02 - 2002-02-04 - Vacation ISO land |
* dd MMM yyyy - dd MMM yyyy - description |
02 Feb 2002 - 04 Feb 2002 - Vacation | |
Yearly: | * mm-dd - description |
07-05 - Every 5th of June 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 yyyy-mm-dd - description |
A 1969-07-20 - First moon landing A 20 Jul 1969 - First moon landing 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 | |
Weekly: | * E DDD - description |
E Wed - Every Wednesday |
* E DDD yyyy-mm-dd - description |
E 2005-01-27 - Every Wednesday Starting 27 Jan 2005 | |
* E DDD yyyy-mm-dd - yyyy-mm-dd - description |
E Wed 2005-01-01 - 2005-01-27 - Every Wednesday from 1 Jan 2005 through 27 Jan 2005 (inclusive) | |
Periodic: | * En yyyy-mm-dd - description |
E3 2002-12-02 - Every three days starting 02 Dec 2002 |
* En yyyy-mm-dd - yyyy-mm-dd - description |
E3 2005-04-12 - 2005-12-31 - Every three days from 12 Apr 2005 through 31 Dec 2005 (inclusive) | |
Exception: | Insert the following between the above syntax and the description:X { yyyy-mm-dd, yyyy-mm-dd - yyyy-mm-dd } |
1 Fri X { 2002-12-01, 2002-12-06 - 2002-12-14 } - Every first Friday except on the 01 Dec 2002 and between 06 Dec 2002 and 14 Dec 2002 |
format
is:
$old<br /><small>$description</small>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:
* $day $mon $yearand
format
is:
$old - $descriptionThis displays the events in a form very similar to that in which they are specified (although specific to a particular date).
%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 %GMTIME%
.
$last(format)
will render the last date of the event in the way just described for $first()
You type: | You get: | If correctly installed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A list of Events is just a bullet list like this:
month="2" year="2002" bgcolor="cyan" }% %CALENDAR{ month="3" year="2002" showweekdayheaders="1" }% |
|
|
%<plugin>_<setting>%
, i.e. %CALENDARPLUGIN_SHORTDESCRIPTION%
data/debug.txt
) * #Set FORMAT = $old<br /><small>$description</small>
HTML::CalendarMonthSimple
and Date::Calc
CPAN packages (see http://www.cpan.org)
Date::Calc
HTML::CalendarMonthSimple
= $todayyear && $self->month =
$todaymonth && defined $thisday && $thisday == $todaydate) 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 && defined $thisday
as shown above. -- TWiki:Main.AngusRogerson - 16 Aug 2004
CalendarPlugin.zip
in your twiki installation directory. Content: File: | Description: |
---|---|
data/TWiki/CalendarPlugin.txt | Plugin topic |
data/TWiki/VarCALENDAR.txt | CALENDAR variable documentation topic |
lib/TWiki/Plugins/CalendarPlugin.pm | Plugin Perl module |
pub/TWiki/CalendarPlugin/exclam.gif | Image file |
configure
in your TWiki installation, and enable the plugin in the {Plugins} section.
|
Plugin Author: | TWiki:Main.AndreaSterbini, TWiki:Main.PeterThoeny, TWiki:Main.NathanKerr, TWiki:Main.DavidBright, TWiki:Main.DanielRohde |
Copyright: | © 2001 TWiki:Main.AndreaSterbini © 2002-2012 TWiki:Main.PeterThoeny © 2002-2012 TWiki:TWiki.TWikiContributor |
License: | GPL (GNU General Public License) |
Plugin Version: | 2012-12-03 |
Change History: | |
2012-12-03: | TWikibug:Item7020: Add VarCALENDAR with category; doc improvements -- TWiki:Main.PeterThoeny |
2011-07-10: | TWikibug:Item6725: Change global package variables from "use vars" to "our" -- TWiki:Main.PeterThoeny |
2011-02-18: | TWikibug:Item6650: Add cellspacing, cellpadding parameters; fix sharpborders="0" issue -- TWiki:Main.PeterThoeny |
2011-02-17: | TWikibug:Item6649: Support anniversary, yearly, weekly and periodic events with ISO date format -- TWiki:Main.PeterThoeny |
2011-02-16: | TWikibug:Item6649: Support exceptions with ISO date format -- TWiki:Main.PeterThoeny |
2011-02-15: | TWikibug:Item6649: Support calendar events with ISO date format, such as 2011-02-15 -- TWiki:Main.PeterThoeny |
V1.020: | TWiki:Main.DavidBright: Bug fix from TWiki:Main.MarcLangheinrich for multiday events that were not properly displayed because the first day occurred in the current month, but before the first day included in the list. |
V1.019: | TWiki:Main.DavidBright: Added support for monthly repeaters specified as "L Fri" (last Friday in all months). |
V1.018: | TWiki:Main.DavidBright: Added capability to display multiple months in one call, display events in a list, and provided for more extensive formatting of date and description of events. |
V1.017: | TWiki:Main.DanielRohde: Added start and end date support for periodic repeaters; Added initlang patch by TWiki:Main.JensKloecker; Changed 'my' to 'local' so exceptions working again; Removed fetchxmap debug message; Fixed illegal date bug; Allowed month abbreviations in month attribute |
V1.016: | TWiki:Main/DavidBright: Added support for anniversary events; changed "our" to "my" in module to support perl versions prior to 5.6.0 |
V1.015: | TWiki:Main.PatriceFournier: Added back support for preview showing unsaved events; Two loop fixes from TWiki:Main.DanielRohde |
V1.014: | TWiki:Main.NathanKerr: Added start and end date support for weekly repeaters |
V1.013: | TWiki:Main.MartinCleaver: Added multiple topic=web.topic parameters |
V1.012: | TWiki:Main/PeterThoeny: Added missing doc of gmtoffset parameter (was deleted in V1.011) |
V1.011: | TWiki:Main/PeterThoeny: Fixed deep recursion bug; preview shows now unsaved events; performance and resource improvements; documented most of HTML::CalendarMonthSimple attributes; TWiki:Main/PaulineCheung: Fixed uninitialized value in join |
V1.010: | TWiki:Main/DanBoitnott: Fixed variable conflict in timezone code |
V1.009: | TWiki:Main/DanBoitnott: Added ability to have event topics in other webs |
V1.008: | TWiki:Main/AnthonPang: Added daynames attribute; TWiki:Main/JensKloecker: Added lang attribute; TWiki:Main/DanBoitnott: Added yearly, monthly, weekly, and periodic events and exceptions |
V1.006: | TWiki:Main/DanBoitnott: Added monthly date support |
V1.005: | TWiki:Main/AkimDemaille: handle date intervals (thanks!) |
V1.004: | uses only HTML::CalendarMonthSimple, ISO dates, all possible settings, fixed month bug |
V1.003: | introducing HTML::CalendarMonthSimple |
V1.002: | TWiki:Main/ChristianSchultze: highlight today, relative month/year and debugging (thanks!) |
V1.001: | delayed load of used packages |
V1.000: | first release using only HTML::CalendarMonth |
TWiki Dependency: | $TWiki::Plugins::VERSION 1.010 |
CPAN Dependencies: | CPAN:HTML::CalendarMonthSimple >= v1.23, CPAN:Date::Calc |
Other Dependencies: | none |
Perl Version: | 5.000 and up |
TWiki:Plugins/Benchmark: | GoodStyle 95%, FormattedSearch 97%, CalendarPlugin 88% with installed Plugin |
Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/CalendarPlugin |
Feedback: | http://TWiki.org/cgi-bin/view/Plugins/CalendarPluginDev |
Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/CalendarPluginAppraisal |