Template:Roman Year/doc: Difference between revisions

From Imperivm Romanvm
Jump to navigation Jump to search
(Created page with "{{Documentation subpage}} {{Lua|Module:Roman Year}} {{Lua sidebar}} * This module supports years in both CE and BCE, but with caveats. * This is a new module and may be subject to bugs, to report bugs please use the discord == Usage == {{pre|<nowiki>{{Roman Year|</nowiki>''YYYY''<nowiki>}}</nowiki>}} Replace <code>''YYYY''</code> with the year you would like to be converted to Ab Urbe Condita. When giving a year in BCE, pass the year with a minus sign in front of...")
 
No edit summary
 
Line 15: Line 15:
== Examples ==
== Examples ==
{|class="wikitable" style="text-align:center"
{|class="wikitable" style="text-align:center"
! BCE/CE !! Template call !! Roman Date
! BCE/CE !! Template call !! Ab Urbe Condita
|-
|-
|27 BCE|| <nowiki>{{Roman Year|-27}}</nowiki> || {{Roman Date|2022-06-09}}
|27 BCE|| <nowiki>{{Roman Year|-27}}</nowiki> || {{Roman Year|-27}}
|-
|-
|23 BCE|| <nowiki>{{Roman Year|-23}}</nowiki> || {{Roman Date|2021-10-20}}
|23 BCE|| <nowiki>{{Roman Year|-23}}</nowiki> || {{Roman Year|-23}}
|-
|-
|1 CE|| <nowiki>{{Roman Year|1}}</nowiki> || {{Roman Date|2022-01-01}}
|1 CE|| <nowiki>{{Roman Year|1}}</nowiki> || {{Roman Year|1}}
|-
|-
|1 BCE|| <nowiki>{{Roman Year|-1}}</nowiki> || {{Roman Date|12-23}}
|1 BCE|| <nowiki>{{Roman Year|-1}}</nowiki> || {{Roman Year|-1}}
|-
|-
|01 CE || <nowiki>{{Roman Year|01}}</nowiki> || {{Roman Date|2022-01-01}}
|01 CE || <nowiki>{{Roman Year|01}}</nowiki> || {{Roman Year|01}}
|-
|-
|02 CE || <nowiki>{{Roman Year|02}}</nowiki> || {{Roman Date|02-29}}
|02 CE || <nowiki>{{Roman Year|02}}</nowiki> || {{Roman Year|02}}
|-
|-
|2012 CE || <nowiki>{{Roman Year|2012}}</nowiki> || {{Roman Date|02-28}}
|2012 CE || <nowiki>{{Roman Year|2012}}</nowiki> || {{Roman Year|2012}}
|-
|-
|2024 CE || <nowiki>{{Roman Year|2024}}</nowiki> || {{Roman Date|2024-02-29}}
|2024 CE || <nowiki>{{Roman Year|2024}}</nowiki> || {{Roman Year|2024}}
|-
|-
|2000 CE || <nowiki>{{Roman Year|2000}}</nowiki> || {{Roman Date|2000-02-29}}
|2000 CE || <nowiki>{{Roman Year|2000}}</nowiki> || {{Roman Year|2000}}
|-
|-
|2022 CE || <nowiki>{{Roman Year|2022}}</nowiki> || {{Roman Date|2022-01-13}}
|2022 CE || <nowiki>{{Roman Year|2022}}</nowiki> || {{Roman Year|2022}}
|-
|-
|75 BCE || <nowiki>{{Roman Year|-75}}</nowiki> || {{Roman Date|2020-06-05}}
|75 BCE || <nowiki>{{Roman Year|-75}}</nowiki> || {{Roman Year|-75}}
|-
|-
|2016 CE || <nowiki>{{Roman Year|2016}}</nowiki> || {{Roman Date|2016-02-24}}
|2016 CE || <nowiki>{{Roman Year|2016}}</nowiki> || {{Roman Year|2016}}
|-
|-
|2017 CE || <nowiki>{{Roman Year|2017}}</nowiki> || {{Roman Date|2017-02-24}}
|2017 CE || <nowiki>{{Roman Year|2017}}</nowiki> || {{Roman Year|2017}}
|-
|-
|2001 CE || <nowiki>{{Roman Year|2001}}</nowiki> || {{Roman Date|2001-12-21}}
|2001 CE || <nowiki>{{Roman Year|2001}}</nowiki> || {{Roman Year|2001}}
|-
|-
|{{CURRENTYEAR}} CE || <nowiki>{{Roman Year|</nowiki>{{CURRENTYEAR}}<nowiki>}}</nowiki> || {{Roman Year|{{CURRENTYEAR}}}}
|{{CURRENTYEAR}} CE || <nowiki>{{Roman Year|</nowiki>{{CURRENTYEAR}}<nowiki>}}</nowiki> || {{Roman Year|{{CURRENTYEAR}}}}
Line 49: Line 49:


==Known Bugs==
==Known Bugs==
* Doesn't check for dates that are past the maximum number of days in a month
* If 0 is entered an error occurs, an if statement or check would solve this. This bug is shared with {{tl|Roman Date}}
* Doesn't check for dates below 1 and thus may fail


=== Example ===
{|class="wikitable" style="text-align:center"
! BCE/CE !! Template call !! Ab Urbe Condita
|-
|0 CE|| <nowiki>{{Roman Year|0}}</nowiki> || {{Roman Year|0}}
|-
|0 BCE|| <nowiki>{{Roman Year|-0}}</nowiki> || {{Roman Year|-0}}
|}
==TemplateData==
==TemplateData==
{{TemplateDataHeader}}
{{TemplateDataHeader}}

Latest revision as of 21:30, 10 June 2022

  • This module supports years in both CE and BCE, but with caveats.
  • This is a new module and may be subject to bugs, to report bugs please use the discord

Usage[edit source]

{{Roman Year|YYYY}}

Replace YYYY with the year you would like to be converted to Ab Urbe Condita. When giving a year in BCE, pass the year with a minus sign in front of the year with no space (753 BCE => -753).

For more information please see Roman Dates.

Examples[edit source]

BCE/CE Template call Ab Urbe Condita
27 BCE {{Roman Year|-27}} DCCXXVII AVC
23 BCE {{Roman Year|-23}} DCCXXXI AVC
1 CE {{Roman Year|1}} DCCLIV AVC
1 BCE {{Roman Year|-1}} DCCLIII AVC
01 CE {{Roman Year|01}} DCCLIV AVC
02 CE {{Roman Year|02}} DCCLV AVC
2012 CE {{Roman Year|2012}} MMDCCLXV AVC
2024 CE {{Roman Year|2024}} MMDCCLXXVII AVC
2000 CE {{Roman Year|2000}} MMDCCLIII AVC
2022 CE {{Roman Year|2022}} MMDCCLXXV AVC
75 BCE {{Roman Year|-75}} DCLXXIX AVC
2016 CE {{Roman Year|2016}} MMDCCLXIX AVC
2017 CE {{Roman Year|2017}} MMDCCLXX AVC
2001 CE {{Roman Year|2001}} MMDCCLIV AVC
2024 CE {{Roman Year|2024}} MMDCCLXXVII AVC

Known Bugs[edit source]

  • If 0 is entered an error occurs, an if statement or check would solve this. This bug is shared with {{Roman Date}}

Example[edit source]

BCE/CE Template call Ab Urbe Condita
0 CE {{Roman Year|0}} Lua error in Module:Roman_Year at line 15: attempt to perform arithmetic on global 'avc' (a nil value).
0 BCE {{Roman Year|-0}} Lua error in Module:Roman_Year at line 15: attempt to perform arithmetic on global 'avc' (a nil value).

TemplateData[edit source]

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for Roman Year

Convert years to Ab Urbe Condita.

Template parameters

ParameterDescriptionTypeStatus
Year1

The Year to be converted to Ab Urbe Condita. If the year cannot be processed, nothing will be returned.

Example
2022
Numberoptional

See also[edit source]