Fandom Developers Wiki
Advertisement

This module shows a calendar, with the months and days of the year. It can display a monthly or a yearly calendar with various formatting options.

Installation

Lua installation

CSS installation

Examples

May 2014 monthly calendar
{{Calendar widget|year = 2014|month = May}}


May 2014
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
25262728293031


Current year yearly calendar, with current day highlighted
{{Calendar widget|show_today = yes}}


2022
January
SuMoTuWeThFrSa
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
February
SuMoTuWeThFrSa
  12345
6789101112
13141516171819
20212223242526
2728     
March
SuMoTuWeThFrSa
  12345
6789101112
13141516171819
20212223242526
2728293031  
April
SuMoTuWeThFrSa
     12
3456789
10111213141516
17181920212223
24252627282930
May
SuMoTuWeThFrSa
1234567
891011121314
15161718192021
22232425262728
293031    
June
SuMoTuWeThFrSa
   1234
567891011
12131415161718
19202122232425
2627282930  
July
SuMoTuWeThFrSa
     12
3456789
10111213141516
17181920212223
24252627282930
31      
August
SuMoTuWeThFrSa
 123456
78910111213
14151617181920
21222324252627
28293031   
September
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
252627282930 
October
SuMoTuWeThFrSa
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
November
SuMoTuWeThFrSa
  12345
6789101112
13141516171819
20212223242526
27282930   
December
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
25262728293031

Parameters

Calendar parameters

  • |year= – specifies the year to be used when creating a monthly or yearly calendar; Gregorian calendar only; minimum 1583 for yearly calendar; minimum October 1582 for stand-alone month calendar; when omitted or out of range, uses current year
  • |month= – specifies the month to be used when creating an stand-alone month calendar in the year specified by |year=; accepts a variety values:
    numbers 1 to 12 – defaults to current month when month number is out of range
    month names (January, March, etc) – defaults to current month when month name is not recognized
    keywords:
    current – display the current month
    last – display the month that occurs before the current month
    next – display the month that occurs after the current month
  • |cols= – yearly calendars only; number of columns n to be used for calendar rendering; default is 4; values of n less than 1 or greater than 12 ignored
  • |iso= – accepts the single value yes; calendar renders in ISO week format (Monday through Sunday); not needed if |iso_wk= set
  • |iso_wk= – accepts the single value yes; calendar renders in ISO week format (Monday through Sunday) with ISO week number in the left column; setting |iso_wk=yes automatically sets |iso=yes

Styling parameters

  • |float= – position the rendered calendar; default position is at the left page margin:
    center – middle of the page
    right – at the right page margin
  • |hide_year= – accepts the single value yes; suppresses display of year in calendar headers; alias |show_year=off
  • |show_today= – accepts the single value yes; highlights the current date in the current-month calendar
  • |today_color= – set the highlight color used by |show-today=; alias: |today_colour=
  • |title_color= – set background color for the month title bar; overrides |color=; alias: |title_colour=
  • |week_color= – set background color for the day-abbreviations title bar; overrides |color=; alias: |week_colour=
  • |color= – shorthand for both |title_color= and |week_color=; |color= yields to |title_color= and |week_color=; alias: |colour=
  • |wknum_color= – set background color for ISO week numbers; alias: |wknum_colour=

Linking parameters

  • |lk= – various date component linking options:
    d – link days in calendar to calendar day of calendar month – [[May 26]]
    m – link month in calendar header to month article – [[May]] 2019
    y – link year in calendar header to year article – May [[2022]]
    dm – link to days and month
    dy – link to days and year
    my – link to month and year
    yes – individually link all date components
    m&y – stand-alone month calendars only; link month and year together as a single composite link – [[May 2022]]
    dm&y – stand-alone month calendars only; link to days and composite month/year

Link prefixes and suffixes

These parameters require |lk=:

  • |lk_pref= – prefix for all day, month, and year links enabled by |lk=; yields to specific |lk_pref_x= parameters
  • |lk_suff= – suffix for all day, month, and year links enabled by |lk=; yields to specific |lk_suff_x= parameters

These parameters automatically set |lk= to the appropriate value; override values assigned to |lk_pref= and |lk_suff=:

  • |lk_pref_d= – prefix for day links
  • |lk_pref_m= – prefix for month and composite month/year links
  • |lk_pref_y= – prefix for year links
  • |lk_suff_d= – suffix for day links
  • |lk_suff_m= – suffix for month links and composite month/year links
  • |lk_suff_y= – suffix for year links

For stand-alone month calendars only, links to previous- and next-month targets:

  • |prevnext= – accepts the single value yes; adds generic << and >> links to month header linked to the preceding and next month articles; automatically set if any of the following parameters are set:
    • |lk_pref_mprev= – prefix for previous-month link
    • |lk_suff_mprev= – suffix for previous-month link
    • |lk_pref_mnext= – prefix for next-month link
    • |lk_suff_mnext= – suffix for next-month link
Examples

if the current page and section is [[An example page#May]] and there is a May calendar there, to offer links to the previous month (April) and next month (June) sections set:

|k_pref_mprev=# – creates link to [[An example page#April]]
|k_pref_mnext=# – creates link to [[An example page#June]]

if the current page is a subpage [[An example page/May]] and there is a May calendar there, to offer links to the previous month and next month subpages set:

|k_pref_mprev=../ – creates link to [[An example page/April]]
|k_pref_mnext=../ – creates link to [[An example page/June]]
in ../, .. is the parent ([[An example page]]) and / is the required path separator; see Wikipedia:Uniform Resource Identifier

See also

Advertisement