From GamingWiki
Jump to: navigation, search
(Created page with "{| class="infobox vevent" style="font-size: 90%; width: 20em; background: white" |+ style="font-size: 135%;" | '''<span class="summary dtstart">{{#ifeq:{{{1}}}|BC|{{PAGENAME}}|{{...")
 
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="infobox vevent" style="font-size: 90%; width: 20em; background: white"
+
<!--
|+ style="font-size: 135%;" | '''<span class="summary dtstart">{{#ifeq:{{{1}}}|BC|{{PAGENAME}}|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}}}</span> in other calendars'''
+
 
|-
+
VARIABLES
| [[Gregorian calendar]]
+
 
| {{#if:{{{gregcal|}}}|[[{{{gregcal}}}|{{#ifeq:{{{1}}}|BC|{{PAGENAME}}|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}}}]]|{{#ifeq:{{{1}}}|BC|{{PAGENAME}}|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}}}}} <br /> ''<span style="font-family: serif;">{{Roman|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}}}</span>''
+
  Create a variable to hold the year number.
|-
+
-->{{#vardefine: theyear|<!--
| [[Ab urbe condita]]
+
  -->{{#ifeq:{{{1}}}|BC<!--
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+753 }}
+
      -->|{{PAGENAME}}<!--
|-
+
      -->|{{{year|<!-- Conditional default value:
| [[Armenian calendar]]
+
        -->{{#rmatch:{{PAGENAME}}|^\d+$<!--
| {{ #ifeq: {{#expr: ({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-550) > 0}} | 1 | {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-551 }} <br /> ԹՎ {{Armenian|{{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-551 }}}} | ''N/A''}}
+
            -->|{{PAGENAME}}<!--
|-
+
            -->|{{Campaign year|campaign={{{campaign|}}}}}<!--
| [[Bahá'í calendar]]
+
        -->}}<!--
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-1844 }} – {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-1843 }}
+
      -->}}}<!--
|-
+
  -->}}<!-- end ifeq
| [[Bengali calendar]]
+
-->}}<!--
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-593}}
+
 
|-
+
--><noinclude>
| [[Berber calendar]]
+
:<!--
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+950}}
+
--> We support multiple calendars, if they exist. Calendar definitions are <!--
|-
+
--> stored in subtemplates. If the 'campaign' parameter has been          <!--
| [[Buddhist calendar]]
+
--> specified, and if                                                      <!--
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+544 }}
+
--> <tt>Template:Year in other calendars/{{{campaign}}}</tt> exists, then  <!--
|-
+
--> we transclude it. If {{{campaign}}} is unset or the template does not  <!--
| [[Traditional Burmese calendar|Burmese calendar]]
+
--> exist, we use <tt>Template:Year in other calendars/default</tt>.      <!--
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-638 }}
+
--></noinclude><!--
|-
+
 
| [[Byzantine calendar]]
+
-->{{#vardefine: caltemplate| Year in other calendars/<!--
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+5508 }} – {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+5509 }}
+
  If we've specified a campaign, look for that campaign's subtemplate.
|-
+
  -->{{#ifexist: Template:Year in other calendars/{{{campaign|MAGIC_DNE}}}<!--
| [[Chinese calendar]]
+
      -->|{{{campaign}}}<!--
| <small>[[Sexagenary cycle|{{Chinese calendar/year name|{{ #expr: ({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}} + 55) mod 60 }}}}]]年{{ #if: {{Chinese calendar/cycle|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|1|1}}}} | {{Chinese calendar/month name|{{Chinese calendar/month|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|1|1}}}}}}月{{Chinese calendar/day name|{{Chinese calendar/day|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|1|1}}}}}}日 }}</small><br />({{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}} + 2636 }}/{{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}} + 2696 }}{{ #if: {{Chinese calendar/cycle|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|1|1}}}} | -{{ #ifexpr: {{Chinese calendar/month|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|1|1}}}} >= 0 | {{Chinese calendar/month|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|1|1}}}} | [[intercalary month|intercalary]] {{#expr:abs {{Chinese calendar/month|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|1|1}}}}}}}}-{{Chinese calendar/day|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|1|1}}}} }})<div style="text-align: center;">''— to —''</div><small>[[Sexagenary cycle|{{Chinese calendar/year name|{{ #expr: ({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}} + 56) mod 60 }}}}]]年{{ #if: {{Chinese calendar/cycle|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|12|31}}}} | {{Chinese calendar/month name|{{Chinese calendar/month|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|12|31}}}}}}月{{Chinese calendar/day name|{{Chinese calendar/day|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|12|31}}}}}}日 }}</small><br />({{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}} + 2637 }}/{{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}} + 2697 }}{{ #if: {{Chinese calendar/cycle|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|12|31}}}} | -{{ #ifexpr: {{Chinese calendar/month|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|12|31}}}} >= 0 | {{Chinese calendar/month|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|12|31}}}} | [[intercalary month|intercalary]] {{#expr:abs {{Chinese calendar/month|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|12|31}}}}}}}}-{{Chinese calendar/day|{{JD|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|12|31}}}} }})
+
      -->|default<!--
|-
+
  -->}}<!-- end ifexist
| [[Coptic calendar]]
+
-->}}<!-- end vardefine
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-284}} – {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-283}}
+
--><includeonly>{{#if: {{{campaign|}}} | [[Category: {{{campaign}}}]] }}</includeonly><!--
|-
+
 
| [[Ethiopian calendar]]
+
--><noinclude>
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-8 }} – {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-7 }}
+
:<!--
|-
+
--> The data in the subtemplate is parsed into a HashTable. The keys are  <!--
| [[Hebrew calendar]]
+
--> links to pages describing individual calendars, and the values are    <!--
| {{#expr:{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+3760}} – {{#expr:{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+3761}}
+
--> years (or year ranges, as appropriate) in the alternate calendar. The  <!--
|-
+
--> The format of the data is as follows:
| [[Hindu calendar]]s
+
<pre>
|
+
;; [[calendar 1]] :: {{#perform_calculation_on|{{{year}}}}}
|-
+
;; [[calendar 2]] :: {{{year}}}
| &nbsp;- ''[[Bikram Samwat]]''
+
</pre></noinclude><!--
| {{#expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+56}} – {{#expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+57}}
+
 
|-
+
-->{{#vardefine: caldata|{{ {{#var: caltemplate}}|year={{#var:theyear}}}}}}<!--
| &nbsp;- ''[[Indian national calendar|Shaka Samvat]]''
+
 
| {{ #ifeq: {{#expr: ({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-76) > 0}} | 1 | {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-78 }} – {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-77 }}| ''N/A''}}
+
-->{{#hashdefine: datahash | {{#var:caldata}} | ;; | :: }}<!--
|-
+
  Remove empty keys:
| &nbsp;- ''[[Kali Yuga]]''
+
-->{{#hashexclude: datahash | }}<!--
| {{#expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+3101 }} – {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+3102 }}
+
 
|-
+
-->
| [[Holocene calendar]]
+
 
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+10000 }}
+
{| class="infobox floatright"
|-
+
|+ class="above" | {{#var:theyear}} in other calendars
| [[Iranian calendar]]
+
{{#hashprint: datahash ||%%%% |@@@@ |<nowiki />
| {{ #ifeq: {{#expr: ({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-621) > 0}} | 1 | {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-622 }} – {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-621 }} | {{ #expr: (-1)*({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-622)}} BP – {{ #expr: (-1)*({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-621)}} BP}}
+
{{!}}-
|-
+
{{!}} class="label" {{!}} %%%%
| [[Islamic calendar]]
+
{{!}} @@@@ <!--
| {{ #ifeq: {{#expr: ({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-621) > 0}} | 1 | {{ #expr: floor(1.030684*({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-621.5643))}} – {{ #expr: floor(1.030684*({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-620.5643))}} | {{ #expr: ceil(-1.030684*({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-621.5643))}} BH – {{ #expr: ceil(-1.030684*({{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}-620.5643))}} BH }}
+
-->}}<!-- --><nowiki />
|-
 
| [[Japanese calendar]]
 
| {{Year in other calendars/Japanese
 
  | era = {{Nengo|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}}}
 
  | previous year era = {{Nengo|{{#expr:{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}} - 1}}}}
 
  | year = {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}
 
}}
 
|-
 
| [[Korean calendar]]
 
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+2333 }}
 
|-
 
| [[Thai solar calendar]]
 
| {{ #expr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+543 }}
 
|-
 
{{#ifexpr: {{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}>=1970|{{!}} [[Unix time]]
 
{{!}} {{ #expr:({{age in days|1970|01|01|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}|01|01}}*24*60*60)}} &ndash; {{ #expr: ({{age in days|1970|01|01|{{{year|<noinclude>{{CURRENTYEAR}}</noinclude><includeonly>{{PAGENAME}}</includeonly>}}}+1|01|01}}*24*60*60)-1}}
 
{{!}}-}}
 
 
{{#if: {{{footnotes|}}} |
 
{{#if: {{{footnotes|}}} |
 +
{{!}}-
 
{{!}} colspan="2" {{!}} <small>{{{footnotes|}}}</small>
 
{{!}} colspan="2" {{!}} <small>{{{footnotes|}}}</small>
 
}}
 
}}
 
|-
 
|-
|colspan="2" align="center"| {{Navbar|Year in other calendars|mini=1}}  
+
| colspan="2" class="below" | <!--
 +
--> {{navbar|Year in other calendars|mini=1|nodiv=1|brackets=1|label=Box:}} <!--
 +
--> {{navbar|{{#var:caltemplate}}|mini=1|nodiv=1|brackets=1|label=Data:}}
 
|}<noinclude>
 
|}<noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 07:15, 15 December 2012

We support multiple calendars, if they exist. Calendar definitions are stored in subtemplates. If the 'campaign' parameter has been specified, and if Template:Year in other calendars/{{{campaign}}} exists, then we transclude it. If {{{campaign}}} is unset or the template does not exist, we use Template:Year in other calendars/default.
The data in the subtemplate is parsed into a HashTable. The keys are links to pages describing individual calendars, and the values are years (or year ranges, as appropriate) in the alternate calendar. The The format of the data is as follows:
 ;; [[calendar 1]] :: {{#perform_calculation_on|{{{year}}}}}
 ;; [[calendar 2]] :: {{{year}}}
2024 in other calendars
Gregorian calendar 2024
MMXXIV
Ab urbe condita 2777
Bahá'í calendar 180 – 181
Bengali calendar 1431
Berber calendar 2974
Buddhist calendar 2568
Burmese calendar 1386
Byzantine calendar 7532 – 7533
Coptic calendar 1740 – 1741
Ethiopian calendar 2016 – 2017
Hebrew calendar 5784 – 5785
Holocene calendar 12024
Iranian calendar 1402 – 1403
Islamic calendar 1445 – 1446
Korean calendar 4357
Thai solar calendar 2567
Unix time 1704067200 – 1735689599
 Box: [v  e]   Data: [v  e] 
[create]
Error creating thumbnail: File missing
Template documentation