Module:Calendar widget/doc: Difference between revisions
Appearance
Content deleted Content added
Line 7: | Line 7: | ||
===Calendar parameters=== |
===Calendar parameters=== |
||
*{{para|year}} – specifies the year to be used when creating a monthly or yearly calendar; when omitted uses current year |
*{{para|year}} – specifies the year to be used when creating a monthly or yearly calendar; when omitted uses current year |
||
*{{para|month}} – specifies the month to be used when creating an |
*{{para|month}} – specifies the month to be used when creating an stand-alone month calendar in the year specified by {{para|year}}; accepts a variety values: |
||
*:numbers <code>1</code> to <code>12</code> – defaults to current month when month number is out of range |
*:numbers <code>1</code> to <code>12</code> – defaults to current month when month number is out of range |
||
*:month names (<code>January</code>, <code>March</code>, etc) – defaults to current month when month name is not recognized |
*:month names (<code>January</code>, <code>March</code>, etc) – defaults to current month when month name is not recognized |
||
Line 14: | Line 14: | ||
*::<code>last</code> – display the month that occurs before the current month |
*::<code>last</code> – display the month that occurs before the current month |
||
*::<code>next</code> – display the month that occurs after the current month |
*::<code>next</code> – display the month that occurs after the current month |
||
*{{para|cols}} – yearly calendars only; number of columns <code>{{var|n}}</code> to be used for calendar rendering; default is <code>4</code>; values of <code>{{var|n}}</code> less than 1 or greater than 12 ignored |
|||
*{{para|iso}} – accepts the single value <code>yes</code>; calendar renders in [[ISO week]] format (Monday through Sunday); not needed if {{para|iso-wk}} set |
*{{para|iso}} – accepts the single value <code>yes</code>; calendar renders in [[ISO week]] format (Monday through Sunday); not needed if {{para|iso-wk}} set |
||
*{{para|iso-wk}} – accepts the single value <code>yes</code>; calendar renders in [[ISO week]] format (Monday through Sunday) with ISO week number in the left column; setting {{para|iso-wk|yes}} automatically sets {{para|iso|yes}} |
*{{para|iso-wk}} – accepts the single value <code>yes</code>; calendar renders in [[ISO week]] format (Monday through Sunday) with ISO week number in the left column; setting {{para|iso-wk|yes}} automatically sets {{para|iso|yes}} |
||
Line 37: | Line 38: | ||
*:<code>dy</code> – link to days and year |
*:<code>dy</code> – link to days and year |
||
*:<code>my</code> – link to month and year |
*:<code>my</code> – link to month and year |
||
*:<code>yes</code> – link all date components |
*:<code>yes</code> – individually link all date components |
||
*:<code>m&y</code> – stand-alone month calendars only; link month and year together as a single composite link – <code><nowiki>[[</nowiki>{{CURRENTMONTHNAME}} {{CURRENTYEAR}}]]</code> |
|||
*:<code>dm&y</code> – stand-alone month calendars only; link to days and composite month/year |
|||
====Link prefixes and suffixes==== |
====Link prefixes and suffixes==== |
||
*{{para|lk_pref_d}} – prefix for day links |
*{{para|lk_pref_d}} – prefix for day links |
||
*{{para|lk_pref_m}} – prefix for month links |
*{{para|lk_pref_m}} – prefix for month and composite month/year links |
||
*{{para|lk_pref_y}} – prefix for year links |
|||
*{{para|lk_suff_d}} – suffix for day links |
*{{para|lk_suff_d}} – suffix for day links |
||
*{{para|lk_suff_m}} – suffix for month links |
*{{para|lk_suff_m}} – suffix for month links and composite month/year links |
||
*{{para|prevnext}} – |
*{{para|lk_suff_y}} – suffix for year links |
||
*{{para|prevnext}} – stand-alone month calendars only; accepts the single value <code>yes</code>; adds generic << and >> links to month header linked to the preceding and next month articles |
|||
*{{para|lk_pref_mprev}} – |
*{{para|lk_pref_mprev}} – stand-alone month calendars only; prefix for previous-month link |
||
*{{para|lk_suff_mprev}} – |
*{{para|lk_suff_mprev}} – stand-alone month calendars only; suffix for previous-month link |
||
*{{para|lk_pref_mnext}} – |
*{{para|lk_pref_mnext}} – stand-alone month calendars only; prefix for next-month link |
||
*{{para|lk_suff_mnext}} – |
*{{para|lk_suff_mnext}} – stand-alone month calendars only; suffix for next-month link |
||
=====Examples===== |
=====Examples===== |
Revision as of 20:02, 8 July 2019
{{Module rating }}
Usage
{{#invoke:Calendar widget|calendar}}
Parameters
Calendar parameters
|year=
– specifies the year to be used when creating a monthly or yearly calendar; when omitted 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
to12
– 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 monthlast
– display the month that occurs before the current monthnext
– display the month that occurs after the current month
- numbers
|cols=
– yearly calendars only; number of columnsn
to be used for calendar rendering; default is4
; values ofn
less than 1 or greater than 12 ignored|iso=
– accepts the single valueyes
; calendar renders in ISO week format (Monday through Sunday); not needed if|iso-wk=
set|iso-wk=
– accepts the single valueyes
; 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 pageright
– at the right page margin
|hide_year=
– accepts the single valueyes
; suppresses display of year in calendar headers; alias|show_year=off
|show-today=
– accepts the single valueyes
; 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 –[[June 8]]
m
– link month in calendar header to month article –[[June]] 2019
y
– link year in calendar header to year article –June [[2025]]
dm
– link to days and monthdy
– link to days and yearmy
– link to month and yearyes
– individually link all date componentsm&y
– stand-alone month calendars only; link month and year together as a single composite link –[[June 2025]]
dm&y
– stand-alone month calendars only; link to days and composite month/year
Link prefixes and suffixes
|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|prevnext=
– stand-alone month calendars only; accepts the single valueyes
; adds generic << and >> links to month header linked to the preceding and next month articles|lk_pref_mprev=
– stand-alone month calendars only; prefix for previous-month link|lk_suff_mprev=
– stand-alone month calendars only; suffix for previous-month link|lk_pref_mnext=
– stand-alone month calendars only; prefix for next-month link|lk_suff_mnext=
– stand-alone month calendars only; 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 Uniform Resource Identifier
- in