Template:TodayLetter

From NovaRoma
(Difference between revisions)
Jump to: navigation, search
(make it return correctly on leap year)
m (remv broken leap year system)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
{{#switch: {{ #time: z }} |
+
{{#switch: {{ #expr: {{ #time: z }} mod 8 }} | 0=A | 1=B | 2=C | 3=D | 4=E | 5=F | 6=G | 7=H }}<noinclude>
55= {{#ifeq: {{IsLeapYear}} | 1 | G | H }}|
+
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==
 
==Usage==
Line 12: Line 5:
 
'''<nowiki>{{TodayLetter}}</nowiki>'''
 
'''<nowiki>{{TodayLetter}}</nowiki>'''
  
Returns the nundinal letter for today. Adjusts for leap year.
+
Returns the nundinal letter for today.  
  
==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]]
 
 
</noinclude>
 
</noinclude>

Latest revision as of 00:03, 22 November 2008

A

Usage

{{TodayLetter}}

Returns the nundinal letter for today.


Personal tools