Extension:Calendar-Wikivoyage

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
Calendar-Wikivoyage
Release status: stableCategory:Stable extensions
Implementation Parser function Category:Parser function extensions
Description Creates a table showing the monthly calendar.
Author(s) Roland Unger
Latest version 1.1
MediaWiki 1.32+Category:Extensions with manual MediaWiki version
License GNU General Public License 2.0 or later
Download Category:Extensions in Wikimedia version control
Translate the Calendar-Wikivoyage extension if it is available at translatewiki.net
Issues Open tasks · Report a bug
Category:All extensions

Calendar is an extension that creates a Calendar in pages. This extension was originally from the old Wikivoyage project.

Installation

  • Download and move the extracted Calendar folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Calendar
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'Calendar' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

The Calendar extension implements the following functions:

  • calendar: Creates a table showing the monthly calendar.
  • Example for application:
{{#calendar: 
 | title= Table header. Instead of a missing title the month and year are shown.
 | prevLink= Text or link with the meaning of "previous". The text can contain place-holders.
 | nextLink= Text or link with the meaning of "next". The text can contain place-holders.
 | month= month to show. Possible values are 1 through 12. A missing month is substituted by the current month.
 | year= year to show. A missing year is substituted by the current year.
         Possible values are between 1970 and 2038.
 | offset= offset to the given month/year in months.
 | lang= Language of days and months names. Supported language codes are 'user' (user language) or
         'content' (content language; default).
 | highlightedDays= Highlighted days in addition to the current day. Values are separated by spaces.
 | start= first day of week. Possible values are 0 (Sundays) and 1 (Mondays).
 | position= defines additional floating. Possible values are (nothing), left, right and center
         (case insensitive)
 | 1= to 31= For every day a link can be specified
 | titleLink= Link to the title. The link can contain place-holders. Do not use link parentheses.
 | generalLinks= Identical links to all days. The links can contain place-holders. Do not use link parentheses.
         generalLinks is overwritten by the options 1= to 31=
 | dayCharsCount= maximum numbers of characters for weekday names 
 | monthCharsCount= maximum numbers of characters for month names
 | tableWidth= width of the table. 'none' means no definition, 'default' the default width of 20em
         You can also specify other CSS values like 50%, 300px or 30em.
 | showToday= specify the highlightings of the today's day. 'true' is default.
         'false' prevents highlighting
}}
  • Place-holders for links:
$a - abbreviated weekday name
$A - full weekday name
$b - abbreviated month name
$B - full month name
$d - day of the month, range 01 to 31
$D - day of the month, range 1 to 31
$e - day of the month, range ' 1' to '31'
$m - month as a decimal number, range 01 to 12
$M - next month as a decimal number, range 01 to 12
$n - abbreviated month name of the next month
$N - full month name of the next month
$o - year of the next month as a decimal number without a century, range 00 to 99
$O - year of the next month as a decimal number including the century
$p - abbreviated month name of the previous month
$P - full month name of the previous month
$q - year of the previous month as a decimal number without a century, range 00 to 99
$Q - year of the previous month as a decimal number including the century
$R - previous month as a decimal number, range 01 to 12
$y - year as a decimal number without a century, range 00 to 99
$Y - year as a decimal number including the century
$% - Dollar sign (use it if necessary)

Used style classes

{{#calendar:|position=Right|start=1|lang=user|highlightedDays=1 9 17}} In the Calendar directory you will find the file Calendar.css. It can be overwritten in Common.css or Monobook.css.

  • class="calendar" -- for the table as a whole
  • class="calLeft" -- left floating
  • class="calRight" -- right floating
  • class="prevNext" -- for previous and next links
  • class="calTitle" -- for the table header
  • class="sundays" -- highlighting for sundays
  • class="today" -- highlighting for the date of today
  • class="highlighted" -- additional highlighted dates

Known Problems

It is not possible to convert non-ASCII characters in month names to upper case characters. ucfirst() works only with ASCII characters but not with other Unicode characters.

Category:Extensions used on Wikimedia#Calendar-Wikivoyage Category:Calendar extensions#Calendar-Wikivoyage
Category:All extensions Category:Calendar extensions Category:Extensions in Wikimedia version control Category:Extensions included in Miraheze Category:Extensions included in WikiForge Category:Extensions used on Wikimedia Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:ParserFirstCallInit extensions Category:Parser function extensions Category:Stable extensions