ᱢᱳᱰᱩᱞ:Year in various calendars/doc
This is the documentation page for ᱢᱳᱰᱩᱞ:Year in various calendars
| This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
| ᱜᱨᱮᱜᱳᱨᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱐᱒᱖ MMXXVI |
| ᱟᱵᱽ ᱩᱨᱵᱮ ᱠᱳᱱᱰᱤᱛᱟ | ᱒᱗᱗᱙ |
| ᱟᱨᱢᱮᱱᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱔᱗᱕ ԹՎ ՌՆՀԵ |
| ᱮᱥᱤᱨᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱖᱗᱗᱖ |
| ᱵᱟᱦᱟᱭ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱘᱒–᱑᱘᱓ |
| ᱵᱟᱝᱞᱟ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱔᱓᱒–᱑᱔᱓᱓ |
| ᱵᱟᱨᱵᱟᱨ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱙᱗᱖ |
| ᱵᱩᱫᱫᱷᱚ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱕᱗᱐ |
| ᱵᱚᱨᱢᱤ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱓᱘᱘ |
| ᱵᱟᱭᱡᱮᱱᱴᱟᱭᱤᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱗᱕᱓᱔–᱗᱕᱓᱕ |
| ᱪᱟᱭᱱᱤᱡᱽ ᱠᱮᱞᱮᱱᱰᱟᱨ | 乙巳年 (ᱠᱟᱴᱷ ᱵᱤᱝ) ᱔᱗᱒᱒ ᱥᱮ ᱔᱖᱖᱒ — ᱠᱷᱚᱱ — 丙午年 (ᱥᱮᱸᱜᱮᱞ ᱥᱟᱫᱚᱢ) ᱔᱗᱒᱓ ᱥᱮ ᱔᱖᱖᱓ |
| ᱠᱚᱯᱴᱤᱠ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱗᱔᱒–᱑᱗᱔᱓ |
| ᱰᱤᱥᱠᱳᱨᱰᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱓᱑᱙᱒ |
| ᱤᱛᱷᱤᱭᱳᱯᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱐᱑᱘–᱒᱐᱑᱙ |
| ᱦᱤᱵᱽᱨᱩ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱕᱗᱘᱖–᱕᱗᱘᱗ |
| ᱦᱤᱱᱫᱩ ᱠᱮᱞᱮᱱᱰᱟᱨ | |
| - ᱵᱤᱠᱨᱚᱢ ᱥᱚᱝᱵᱚᱫ | ᱒᱐᱘᱒–᱒᱐᱘᱓ |
| - ᱥᱚᱠᱟ ᱥᱚᱝᱵᱚᱫ | ᱑᱙᱔᱗–᱑᱙᱔᱘ |
| - ᱠᱚᱞᱤ ᱡᱩᱜᱽ | ᱕᱑᱒᱖–᱕᱑᱒᱗ |
| ᱦᱚᱞᱚᱥᱤᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱒᱐᱒᱖ |
| ᱤᱜᱽᱵᱳ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱐᱒᱖–᱑᱐᱒᱗ |
| ᱤᱨᱟᱱᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱔᱐᱔–᱑᱔᱐᱕ |
| ᱤᱥᱞᱟᱢ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱔᱔᱗–᱑᱔᱔᱘ |
| ᱡᱩᱥ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱑᱕ |
| ᱡᱩᱞᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱜᱨᱮᱜᱳᱨᱤᱭᱟᱱ ᱵᱷᱮᱜᱮᱫ ᱑᱓ ᱢᱟᱦᱟᱸ |
| ᱠᱳᱨᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱔᱓᱕᱙ |
| ᱢᱤᱝᱜᱩ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱯᱨᱚ. ᱪᱤᱱ ᱑᱑᱕ 民國᱑᱑᱕年 |
| ᱛᱷᱟᱭ ᱥᱳᱞᱟᱨ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱕᱖᱙ |
| ᱤᱣᱱᱤᱠᱥ ᱚᱠᱛᱚ | ᱑᱗᱖᱗᱒᱒᱕᱖᱐᱐ – ᱑᱗᱙᱘᱗᱖᱑᱕᱙᱙ |
| ᱜᱨᱮᱜᱳᱨᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱐᱒᱖ MMXXVI |
| ᱟᱵᱽ ᱩᱨᱵᱮ ᱠᱳᱱᱰᱤᱛᱟ | ᱒᱗᱗᱙ |
| ᱟᱨᱢᱮᱱᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱔᱗᱕ ԹՎ ՌՆՀԵ |
| ᱮᱥᱤᱨᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱖᱗᱗᱖ |
| ᱵᱟᱦᱟᱭ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱘᱒–᱑᱘᱓ |
| ᱵᱟᱝᱞᱟ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱔᱓᱒–᱑᱔᱓᱓ |
| ᱵᱟᱨᱵᱟᱨ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱙᱗᱖ |
| ᱵᱩᱫᱫᱷᱚ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱕᱗᱐ |
| ᱵᱚᱨᱢᱤ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱓᱘᱘ |
| ᱵᱟᱭᱡᱮᱱᱴᱟᱭᱤᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱗᱕᱓᱔–᱗᱕᱓᱕ |
| ᱪᱟᱭᱱᱤᱡᱽ ᱠᱮᱞᱮᱱᱰᱟᱨ | 乙巳年 (ᱠᱟᱴᱷ ᱵᱤᱝ) ᱔᱗᱒᱒ ᱥᱮ ᱔᱖᱖᱒ — ᱠᱷᱚᱱ — 丙午年 (ᱥᱮᱸᱜᱮᱞ ᱥᱟᱫᱚᱢ) ᱔᱗᱒᱓ ᱥᱮ ᱔᱖᱖᱓ |
| ᱠᱚᱯᱴᱤᱠ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱗᱔᱒–᱑᱗᱔᱓ |
| ᱰᱤᱥᱠᱳᱨᱰᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱓᱑᱙᱒ |
| ᱤᱛᱷᱤᱭᱳᱯᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱐᱑᱘–᱒᱐᱑᱙ |
| ᱦᱤᱵᱽᱨᱩ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱕᱗᱘᱖–᱕᱗᱘᱗ |
| ᱦᱤᱱᱫᱩ ᱠᱮᱞᱮᱱᱰᱟᱨ | |
| - ᱵᱤᱠᱨᱚᱢ ᱥᱚᱝᱵᱚᱫ | ᱒᱐᱘᱒–᱒᱐᱘᱓ |
| - ᱥᱚᱠᱟ ᱥᱚᱝᱵᱚᱫ | ᱑᱙᱔᱗–᱑᱙᱔᱘ |
| - ᱠᱚᱞᱤ ᱡᱩᱜᱽ | ᱕᱑᱒᱖–᱕᱑᱒᱗ |
| ᱦᱚᱞᱚᱥᱤᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱒᱐᱒᱖ |
| ᱤᱜᱽᱵᱳ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱐᱒᱖–᱑᱐᱒᱗ |
| ᱤᱨᱟᱱᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱔᱐᱔–᱑᱔᱐᱕ |
| ᱤᱥᱞᱟᱢ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱔᱔᱗–᱑᱔᱔᱘ |
| ᱡᱩᱥ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱑᱑᱕ |
| ᱡᱩᱞᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱜᱨᱮᱜᱳᱨᱤᱭᱟᱱ ᱵᱷᱮᱜᱮᱫ ᱑᱓ ᱢᱟᱦᱟᱸ |
| ᱠᱳᱨᱤᱭᱟᱱ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱔᱓᱕᱙ |
| ᱢᱤᱝᱜᱩ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱯᱨᱚ. ᱪᱤᱱ ᱑᱑᱕ 民國᱑᱑᱕年 |
| ᱛᱷᱟᱭ ᱥᱳᱞᱟᱨ ᱠᱮᱞᱮᱱᱰᱟᱨ | ᱒᱕᱖᱙ |
| ᱤᱣᱱᱤᱠᱥ ᱚᱠᱛᱚ | ᱑᱗᱖᱗᱒᱒᱕᱖᱐᱐ – ᱑᱗᱙᱘᱗᱖᱑᱕᱙᱙ |
This module produces the sidebar opposite displaying a given Gregorian year in various different calendars.
Syntax
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]Simple
{{ᱪᱷᱟᱸᱪ:Hashinvoke:Year in various calendars|main}}
All parameters
{{ᱪᱷᱟᱸᱪ:Hashinvoke:Year in various calendars|main |year=(n) |footnotes=(footnotes) |gregcal=(article name)}}
Parameters
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]- year
- Number specifying the year to be displayed. This can be negative and also can be in the format "n BC" to display BC dates or "AD n" as an alternative to a positive number. If not specified, the current year is used.
- footnotes
- Any footnotes to be placed at the bottom of the sidebar.
- gregcal
- Name of an article to be displayed for Gregorian and Julian years (e.g. "2000 BC"). Do not include square brackets.
Microformat
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]Adding new calendars
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]The module is set up to allow for easy addition of new calendars. Just scroll down to the "Build the box" section of the module code, and add your calendar as follows:
To display one year:
local myCalendar = calendar:new()
myCalendar:setLink( 'My calendar article' ) -- The name of the calendar's Wikipedia article.
myCalendar:setYear( year + 10 ) -- Lua code linking the Gregorian calendar year to your calendar's year.
box:addCalendar( myCalendar )
To display a year range:
local myCalendar = calendar:new()
myCalendar:setLink( 'My calendar article' ) -- The name of the calendar's Wikipedia article.
myCalendar:setYearRange( year + 10, year + 11 ) -- Lua code outputting the start year and the end year of the year range.
box:addCalendar( myCalendar )
More complicated calendars can be passed as a string to calendar:setYear().
Technical details
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]The module defines three classes which do the work of setting up the sidebar and displaying the data provided by the calendar functions. These are the calendarBox class, which defines the sidebar; the calendar class, which holds the data for one calendar; and the calendarGroup object, which defines a group of calendar objects with a heading.
To load these classes from another module, use the following:
local yearInOtherCalendars = require( 'Module:Year in various calendars' )
local calendarBox = yearInOtherCalendars.calendarBox
local calendarGroup = yearInOtherCalendars.calendarGroup
local calendar = yearInOtherCalendars.calendar
calendarBox class
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]A calendarBox object is initiated with:
local myCalendarBox = calendarBox:new{ year = yyyy, footnotes = footnotes, navbar = page name }
year- sets the Gregorian year to base calendar calculations on. If not specified, the current year is used.footnotes- sets text to be displayed in a footnotes section at the bottom of the sidebar.navbar- sets the page name to be used by the navbar.
Calendar box objects have the following properties:
calendarBox.year- the Gregorian year number. This is negative for BC years; for example, for the year 100 BC the value of calendarBox.year is-99. (BC years are calculated by "1 - n" rather than "0 - n", as there is no year zero.)calendarBox.yearText- the Gregorian year text. This is a string value of the format "n" for AD years and "n BC" for BC years.calendarBox.caption- the text of the box caption (the bold text that appears directly above the box). The default caption is the value ofcalendarBox.yearText.calendarBox.footnotes- the text of the box footnotes.calendarBox.navbar- the page name used by the navbar.
Calendar box objects have the following methods:
calendarBox:setCaption( caption )- sets the box caption (the bold text that appears directly above the box). The default caption is the value ofcalendarBox.yearText.calendarBox:addCalendar( obj )- adds a calendar object or a calendar group object to the calendar box.calendarBox:addCalendarGroup( obj )- an alias formyCalendarBox:addCalendar().calendarBox:export()- converts the calendar box object to wikicode. This callscalendar:export()andcalendarGroup:export()to export calendar objects and calendar group objects.
calendar class
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]A calendar object is initiated with:
local myCalendar = calendar:new()
Calendar objects have the following properties:
calendar.link- the link name.calendar.year- the year value. This is always a string value.
Calendar objects have the following methods:
calendar:setLink( link, display )- sets the link name for the calendar object.linkis the name of Wikipedia's article about the calendar, anddisplayis an optional display name for the article link.calendar:setRawLink( wikitext )- sets the calendar link as raw wikitext.calendar:getLink()- gets the link value.calendar:setYear( year )- sets the year value for the calendar.yearcan be a number or a string.calendar:setYearRange( startYear, endYear )- sets the year value for the calendar as a year range. BothstartYearandendYearmust be number values.calendar:export()- exports the calendar to wikitext. If no link value was found, this returnsnil. If a link was found but no year value was found, the calendar is output with a value ofN/Afor the year.
calendarGroup class
[ᱯᱷᱮᱰᱟᱛ ᱥᱟᱯᱲᱟᱣ]A calendarGroup object is initiated with:
local myCalendarGroup = calendarGroup:new{ heading = heading }
heading- the wikitext heading for the calendar group (e.g.[[Hindu calendar]]s).
Calendar group objects have one property:
calendarGroup.heading- the calendar group heading text.
Calendar group objects have the following methods:
calendarGroup:addCalendar( obj )- adds a calendar object to the calendar group.calendarGroup:export()- converts a calendar group to wikitext. Callscalendar:export()to export individual calendar objects.