1,296 bytes added
, 23:50, 30 November 2006
<includeonly>:''This template documentation is transcluded from [[{{FULLPAGENAME}}/doc]]'' [<span class="plainlinks">[{{fullurl:{{FULLPAGENAMEE}}/doc|action=edit}} edit]</span>]</includeonly>
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE -->
----
; Usage:
: {{Tlx|IsLeapYear|''year''}}
: ''year'' defaults to {{evaldemo|CURRENTYEAR|=}}.
; Formula:
: <nowiki>{{#expr: ((({{{1}}}) mod 4 = 0) and (({{{1}}}) mod 100 != 0)) or (({{{1}}}) mod 400 = 0)}}</nowiki>
: Use {{subst:IsLeapYear}} to get this code ready for [[Help:Substitution#Optional_substitution|optional substitution]] into another template.
; Sanity check:
: {{evaldemo/3|IsLeapYear|2000}}
: {{evaldemo/3|IsLeapYear|2007}}, 2007 is not a leap year.
: {{evaldemo/3|IsLeapYear|2008}}, 2008 is a leap year.
: {{evaldemo/3|IsLeapYear|2100}}, 2100 is not a leap year.
: {{evaldemo/3|IsLeapYear|2400}}, 2400 is a leap year.
: {{evaldemo/3|IsLeapYear|1500}}, [[Proleptic Gregorian calendar|proleptic Gregorian calendar]].
: {{evaldemo/3|IsLeapYear|-100}} for 101 BC (mostly pointless).
: {{evaldemo/3|IsLeapYear|502*4-8}}, guess why.
Results for fractions like {{evaldemo/3|IsLeapYear|2000.9|5==}} are unspecified, even if it apparently gives an "expected" result at the moment this might change without notice.