Template:Roman Date/doc: Difference between revisions

From Imperivm Romanvm
Jump to navigation Jump to search
(Created page with "{{Lua sidebar}} This module implements the {{tl|Roman Date}} template. For behavioural documentation, please see the template page. * This module supports dates formatted in the form YYYY-MM-DD or MM-DD * This is a new module and may be subject to bugs, to report bugs please use the discord * This module also supports leap years ==Known Bugs== * Doesn't check for dates that are past the maximum number of days in a month * Doesn't check for dates below 1 and thus may fail")
 
No edit summary
Line 1: Line 1:
{{Documentation subpage}}
{{Lua|Module:Roman Date}}
{{Lua sidebar}}
{{Lua sidebar}}


Line 5: Line 7:
* This module supports dates formatted in the form YYYY-MM-DD or MM-DD
* This module supports dates formatted in the form YYYY-MM-DD or MM-DD
* This is a new module and may be subject to bugs, to report bugs please use the discord
* This is a new module and may be subject to bugs, to report bugs please use the discord
* This module also supports leap years
* This module also supports leap years which are handled as per the current leap year standard:
** if (year is not divisible by 4) then (it is a common year)
** else if (year is not divisible by 100) then (it is a leap year)
** else if (year is not divisible by 400) then (it is a common year)
** else (it is a leap year)
 
== Usage ==
{{pre|<nowiki>{{Roman Date|</nowiki>''YYYY-MM-DD''<nowiki>}}</nowiki>}}
 
Replace <code>''YYYY-MM-DD''</code> with the date you would like to be converted to Roman dating.
 
For more information please see [[Roman Dates]].
 
== Examples ==
{|class="wikitable" style="text-align:center"
! Gregorian Calendar !! Template call !! Roman Date
|-
|2022-06-09 || <nowiki>{{Roman Date|2022-06-09}}</nowiki> || {{Roman Date|2022-06-09}}
|-
|2021-10-20|| <nowiki>{{Roman Date|2021-10-20}}</nowiki> || {{Roman Date|2021-10-20}}
|-
|2022-01-01|| <nowiki>{{Roman Date|2022-01-01}}</nowiki> || {{Roman Date|2022-01-01}}
|-
|12-23|| <nowiki>{{Roman Date|12-23}}</nowiki> || {{Roman Date|12-23}}
|-
|01-01 || <nowiki>{{Roman Date|01-01}}</nowiki> || {{Roman Date|2022-01-01}}
|-
|02-29 || <nowiki>{{Roman Date|02-29}}</nowiki> || {{Roman Date|02-29}}
|-
|02-28 || <nowiki>{{Roman Date|02-28}}</nowiki> || {{Roman Date|02-28}}
|-
|2024-02-29 || <nowiki>{{Roman Date|2024-02-29}}</nowiki> || {{Roman Date|2024-02-29}}
|-
|2000-02-29 || <nowiki>{{Roman Date|2000-02-29}}</nowiki> || {{Roman Date|2000-02-29}}
|-
|2022-01-13 || <nowiki>{{Roman Date|2022-01-13}}</nowiki> || {{Roman Date|2022-01-13}}
|-
|2020-06-05 || <nowiki>{{Roman Date|2020-06-05}}</nowiki> || {{Roman Date|2020-06-05}}
|-
|2016-02-24 || <nowiki>{{Roman Date|2016-02-24}}</nowiki> || {{Roman Date|2016-02-24}}
|-
|2017-02-24 || <nowiki>{{Roman Date|2017-02-24}}</nowiki> || {{Roman Date|2017-02-24}}
|-
|2001-12-21 || <nowiki>{{Roman Date|2001-12-21}}</nowiki> || {{Roman Date|2001-12-21}}
|-
|{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY2}} || <nowiki>{{Roman Date|</nowiki>{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY2}}<nowiki>}}</nowiki> || {{Roman Date|{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY2}}}}
|}
 
==Known Improvements==
* In the future the year should also be converted to AVC to consular years (much more difficult).
* All years should be given as CE, for dates that are BCE please make the year negative.


==Known Bugs==
==Known Bugs==
* Doesn't check for dates that are past the maximum number of days in a month
* Doesn't check for dates that are past the maximum number of days in a month
* Doesn't check for dates below 1 and thus may fail
* Doesn't check for dates below 1 and thus may fail
==TemplateData==
{{TemplateDataHeader}}
<templatedata>
{
"params": {
"1": {
"type": "date",
"label": "Date",
"example": "2022-06-09",
"description": "The date to be converted to Roman dating format (counting towards the nearest holy day). This can be in the format YYYY-MM-DD or MM-DD. If the date cannot be processed, nothing will be returned."
}
},
"description": "Convert dates to Roman dating format."
}
</templatedata>
==See also==
* {{tl|Roman Numeral}}
* [[Roman Dates]]

Revision as of 14:20, 9 June 2022

This module implements the {{Roman Date}} template. For behavioural documentation, please see the template page.

  • This module supports dates formatted in the form YYYY-MM-DD or MM-DD
  • This is a new module and may be subject to bugs, to report bugs please use the discord
  • This module also supports leap years which are handled as per the current leap year standard:
    • if (year is not divisible by 4) then (it is a common year)
    • else if (year is not divisible by 100) then (it is a leap year)
    • else if (year is not divisible by 400) then (it is a common year)
    • else (it is a leap year)

Usage

{{Roman Date|YYYY-MM-DD}}

Replace YYYY-MM-DD with the date you would like to be converted to Roman dating.

For more information please see Roman Dates.

Examples

Gregorian Calendar Template call Roman Date
2022-06-09 {{Roman Date|2022-06-09}} a.d. V Id. Junias MMDCCLXXV AVC
2021-10-20 {{Roman Date|2021-10-20}} a.d. XIII Kal. Novembres MMDCCLXXIV AVC
2022-01-01 {{Roman Date|2022-01-01}} Kal. Januariis MMDCCLXXV AVC
12-23 {{Roman Date|12-23}} a.d. X Kal. Januarias
01-01 {{Roman Date|01-01}} Kal. Januariis MMDCCLXXV AVC
02-29 {{Roman Date|02-29}} pr. Kal. Martias
02-28 {{Roman Date|02-28}} pr. Kal. Martias
2024-02-29 {{Roman Date|2024-02-29}} Lua error in Module:Roman_Date at line 116: attempt to concatenate field '?' (a table value).
2000-02-29 {{Roman Date|2000-02-29}} Lua error in Module:Roman_Date at line 116: attempt to concatenate field '?' (a table value).
2022-01-13 {{Roman Date|2022-01-13}} Id. Januariis MMDCCLXXV AVC
2020-06-05 {{Roman Date|2020-06-05}} Non. Juniis MMDCCLXXIII AVC
2016-02-24 {{Roman Date|2016-02-24}} a.d. VI Kal. Martias MMDCCLXIX AVC
2017-02-24 {{Roman Date|2017-02-24}} a.d. VI Kal. Martias MMDCCLXX AVC
2001-12-21 {{Roman Date|2001-12-21}} a.d. XII Kal. Januarias MMDCCLIV AVC
2024-11-22 {{Roman Date|2024-11-22}} a.d. X Kal. Decembres MMDCCLXXVII AVC

Known Improvements

  • In the future the year should also be converted to AVC to consular years (much more difficult).
  • All years should be given as CE, for dates that are BCE please make the year negative.

Known Bugs

  • Doesn't check for dates that are past the maximum number of days in a month
  • Doesn't check for dates below 1 and thus may fail

TemplateData

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 Date

Convert dates to Roman dating format.

Template parameters

ParameterDescriptionTypeStatus
Date1

The date to be converted to Roman dating format (counting towards the nearest holy day). This can be in the format YYYY-MM-DD or MM-DD. If the date cannot be processed, nothing will be returned.

Example
2022-06-09
Dateoptional

See also