Template:ISOCALENDAR/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Script error: No such module "Message box". You might also want to check out Module:Calendar widget or Template:Calendar.

Parameters

1 title
y calendar year
m calendar month
s width in percent of each column of day (default is 10)
cw week number to highlight
cdow weekday to highlight
hideweek (optional) Suppresses display of week-number column if there's anything in this param

All parameters are optional.

  • m and cdow may be fully spelt out, abbreviated or numeric.
  • The numbering for cw and cdow is in accordance with ISO 8601 (ISO week date: Monday → 1, Tuesday → 2, ... Sunday → 7)

Output

Title

The calendar title is determined by 1 (the first unnamed parameter), the default is the month and year of the calendar displayed.

Month

The month of the calendar displayed is determined by m.

  • If m is specified, then the year can be specified with y, the default is the current year.
  • If m is not specified but 1 is a valid time the month and/or year is set to match the title, the default is the current month and/or year.

Highlighting

By default the current day is highlighted. To highlight (an)other day(s) use cw and cdow. cw gives the week and cdow the day of the week to be highlighted.

  • Together they determine a specific day to be highlighted.
  • cw alone will highlight the whole week.
  • cdow alone will highlight the given week day for the whole month.

Examples

Displaying the current month

To display the current month use {{ISOCALENDAR}}.

Template:ISOCALENDAR/month
May 2026
Week Mon Tue Wed Thu Fri Sat Sun

Displaying a given month of the current year

A given month of this year can be specified with 1. Alternatively, m can be used. Perhaps you want a different title e.g. {{ISOCALENDAR|This November|m=11|y=2006}}.

{{ISOCALENDAR|August}} {{ISOCALENDAR|m=Sep}}
Template:ISOCALENDAR/month
August
Week Mon Tue Wed Thu Fri Sat Sun
Template:ISOCALENDAR/month
September 2026
Week Mon Tue Wed Thu Fri Sat Sun

Displaying a given month of a given year

A given month and year can be specified with 1 like this. Alternatively m and y can be used. Perhaps you want a different title e.g. "Quintilis".

{{ISOCALENDAR|May 2006}} {{ISOCALENDAR|m=June|y=2006}} {{ISOCALENDAR|Quintilis MMVI|m=5|y=2006}}
Template:ISOCALENDAR/month
May 2006
Week Mon Tue Wed Thu Fri Sat Sun
Template:ISOCALENDAR/month
June 2006
Week Mon Tue Wed Thu Fri Sat Sun
Template:ISOCALENDAR/month
Quintilis MMVI
Week Mon Tue Wed Thu Fri Sat Sun

Highlight a week, a day of the week, or a day, or a date, or hide display of the week column

You can highlight "Saturday of week 3 in January 2021", "all of week 6 in February 2021", or "all Thursdays of March 2021" like this:

{{ISOCALENDAR|January 2021|cw=3|cdow=Sat}} {{ISOCALENDAR|February 2021|cw=23}} {{ISOCALENDAR|March 2021|cdow=4|hideweek=yes}}
Template:ISOCALENDAR/month
January 2021
Week Mon Tue Wed Thu Fri Sat Sun
Template:ISOCALENDAR/month
February 2021
Week Mon Tue Wed Thu Fri Sat Sun
Template:ISOCALENDAR/month
March 2021
Mon Tue Wed Thu Fri Sat Sun

Highlighting a specific date based on a timestamp is somewhat more difficult, because you can't just pass the date into this template, you have to calculate the week number and day of week. Luckily, we have ParserFunctions that can parse all sorts of time data (in which there are even ready-made functions to get zero-padded ISO 8601 numbers: W for week and N for day-of-week). This can be done like so:

{{ISOCALENDAR
    |September 2001
    |cw   = {{#time: W|2001-09-11 12:46:40}}
    |cdow = {{#time: N|2001-09-11 12:46:40}}
}}
Template:ISOCALENDAR/month
September 2001
Week Mon Tue Wed Thu Fri Sat Sun

Single-line format looks like:

{{ISOCALENDAR|January 2001|cw={{#time: W|foo}}|cdow = {{#time: N|foo}}}}

Adjusting the width

{{ISOCALENDAR|s=14}} gives

Template:ISOCALENDAR/month
May 2026
Week Mon Tue Wed Thu Fri Sat Sun

Sub-templates

The main Template:ISOCALENDAR calls