Difference between revisions of "Template:Rosharan date"

From The Coppermind
Jump to navigation Jump to search
m (+classes)
m (add a missing-date catcher, and improve the docs)
Line 18: Line 18:
 
-->{{#switch:{{number|{{{4|}}}|}}| 1=es| 2=an| 3=ach| 4=ev| 5=ah}}<!--
 
-->{{#switch:{{number|{{{4|}}}|}}| 1=es| 2=an| 3=ach| 4=ev| 5=ah}}<!--
   
-->{{#if:{{{2|}}}|&#32;}}{{{1|}}}</span><!--
+
-->{{#if:{{{2|}}}|&#32;|{{#if:{{{missing-date|}}}|<span class="error" title="{{date/no-args}}">?</span>}}|}}{{{1|}}}</span><!--
   
 
end of {{{1}}}
 
end of {{{1}}}
Line 27: Line 27:
 
-->}}|}}<noinclude>This template outputs dates according to the [[Vorin]] format. {{t|Rosharan date|YYYY|MM|WW|DD}}
 
-->}}|}}<noinclude>This template outputs dates according to the [[Vorin]] format. {{t|Rosharan date|YYYY|MM|WW|DD}}
   
This template can take in the arguments ''year'', ''month'', ''week'', and ''day''. You need not use every argument in order for this template to work. If any more than the year parameter is provided the
+
This template can take in the arguments ''year'', ''month'', ''week'', and ''day''. You need not use every argument in order for this template to work. If any more than the year parameter is provided the date will be converted into a Vorin textual form, and hovering will show in the {{t|Rosharan numeric date}} format <code>YYYY.MM.WW.DD</code>. If the <code>missing-date</code> parameter is filled instead of the month/week/day parts, it will show a red question-mark with a hover error message. Similarly if the <code>year</code> is missing the template will show an error question-mark unless the <code>no-year</code> parameter is passed.
   
 
[[category: date templates]]
 
[[category: date templates]]
   
 
== Examples ==
 
== Examples ==
 
 
* The input {{t|Rosharan date|1174}} would yield '''{{Rosharan date|1174}}'''.
 
* The input {{t|Rosharan date|1174}} would yield '''{{Rosharan date|1174}}'''.
 
* The input {{t|Rosharan date|1174|2|3|4}} yields '''{{Rosharan date|1174|2|3|4}}'''.
 
* The input {{t|Rosharan date|1174|2|3|4}} yields '''{{Rosharan date|1174|2|3|4}}'''.

Revision as of 15:08, 27 December 2017

This template outputs dates according to the Vorin format. {{Rosharan date|YYYY|MM|WW|DD}}

This template can take in the arguments year, month, week, and day. You need not use every argument in order for this template to work. If any more than the year parameter is provided the date will be converted into a Vorin textual form, and hovering will show in the {{Rosharan numeric date}} format YYYY.MM.WW.DD. If the missing-date parameter is filled instead of the month/week/day parts, it will show a red question-mark with a hover error message. Similarly if the year is missing the template will show an error question-mark unless the no-year parameter is passed.

Examples

Users