Difference between revisions of "Template:IsLeapYear/doc"

From blackwiki
Jump to navigation Jump to search
imported>Tlustulimu
m (interwiki)
imported>Bultro
m
Line 26: Line 26:
 
<!-- ADD INTERWIKIS BELOW THIS LINE -->
 
<!-- ADD INTERWIKIS BELOW THIS LINE -->
 
[[hsb:Předłoha:IsLeapYear]]
 
[[hsb:Předłoha:IsLeapYear]]
 +
[[it:Template:Bisestile]]
 
[[mk:Шаблон:IsLeapYear]]
 
[[mk:Шаблон:IsLeapYear]]
 
[[nl:Sjabloon:Schrikkeljaar]]
 
[[nl:Sjabloon:Schrikkeljaar]]
 
[[pt:Predefinição:AnoBissexto]]
 
[[pt:Predefinição:AnoBissexto]]
 
</includeonly>
 
</includeonly>

Revision as of 16:12, 3 June 2009

Template:Template doc page


Usage:
{{IsLeapYear|year}}
year defaults to {{CURRENTYEAR}} = 2026.
Formula:
{{#expr: ((({{{1}}}) mod 4 = 0) and (({{{1}}}) mod 100 != 0)) or (({{{1}}}) mod 400 = 0)}}
Use {{subst:IsLeapYear}} to get this code ready for optional substitution into another template.
Sanity check:
{{ IsLeapYear | 2000 }} gives 1
{{ IsLeapYear | 2007 }} gives 0, 2007 is not a leap year.
{{ IsLeapYear | 2008 }} gives 1, 2008 is a leap year.
{{ IsLeapYear | 2100 }} gives 0, 2100 is not a leap year.
{{ IsLeapYear | 2400 }} gives 1, 2400 is a leap year.
{{ IsLeapYear | 1500 }} gives 0, proleptic Gregorian calendar.
{{ IsLeapYear | -100 }} gives 0 for 101 BC (mostly pointless).
{{ IsLeapYear | 502*4-8 }} gives 1, guess why.

Results for fractions like {{ IsLeapYear | 2000.9 }} = 1 are unspecified, even if it apparently gives an "expected" result at the moment this might change without notice.