Template:TodayLetter

From NovaRoma
(Difference between revisions)
Jump to: navigation, search
m (re cat)
(make it return correctly on leap year)
Line 1: Line 1:
<onlyinclude>{{#switch: {{ #expr: {{ #time: z }} mod 8 }} | 0=A | 1=B | 2=C | 3=D | 4=E | 5=F | 6=G | 7=H }}</onlyinclude>
+
{{#switch: {{ #time: z }} |
----
+
55= {{#ifeq: {{IsLeapYear}} | 1 | G | H }}|
This template calculates the nundinal letter for today.
+
56= {{#ifeq: {{IsLeapYear}} | 1 | H | A }}|
 +
57= {{#ifeq: {{IsLeapYear}} | 1 | A | B }}| 
 +
58= {{#ifeq: {{IsLeapYear}} | 1 | B | C }}| 
 +
59= {{#ifeq: {{IsLeapYear}} | 1 | C | D }}|
 +
{{#switch: {{ #expr: {{ #time: z }} mod 8 }} | 0=A | 1=B | 2=C | 3=D | 4=E | 5=F | 6=G | 7=H }}
 +
}}<noinclude>
 +
 
 +
==Usage==
 +
 
 +
'''<nowiki>{{TodayLetter}}</nowiki>'''
 +
 
 +
Returns the nundinal letter for today. Adjusts for leap year.
 +
 
 +
==Notes==
 +
 
 +
"#time z" is DOY counting from 0.
 +
*Feb 25 is day #55 in this system.
 +
*Feb 29/Mar 1 is day 59 in this system.
 +
 
 +
For this span of days, the template uses brute force, selecting a letter based on the value returned by
 +
[[Template:[[IsLeapYear]]
  
 
[[Category:Date templates]]
 
[[Category:Date templates]]
 +
</noinclude>

Revision as of 03:35, 12 January 2008

F

Usage

{{TodayLetter}}

Returns the nundinal letter for today. Adjusts for leap year.

Notes

"#time z" is DOY counting from 0.

  • Feb 25 is day #55 in this system.
  • Feb 29/Mar 1 is day 59 in this system.

For this span of days, the template uses brute force, selecting a letter based on the value returned by [[Template:IsLeapYear

Personal tools