Open main menu

OrthodoxWiki β

Changes

Template:IsLeapYear

1,038 bytes added, 03:15, April 20, 2007
no edit summary
{{{{{subst|}}}#expr: ((({{{1|{{CURRENTYEAR}}}}}) mod 4 = 0) and (({{{1|{{CURRENTYEAR}}}}}) mod 100 != 0)) or (({{{1|{{CURRENTYEAR}}}}}) mod 400 = 0)}}<noinclude>
----
; Usage&#58;
: {{Tlx|{{PAGENAME}}|''year''}}
: ''year'' defaults to {{evaldemo|CURRENTYEAR|&#61;}}.
; Formula&#58;
: <nowiki>{{#expr: ((({{{1}}}) mod 4 = 0) and (({{{1}}}) mod 100 != 0)) or (({{{1}}}) mod 400 = 0)}}</nowiki>
: Use {&#123;subst:{{PAGENAME}}&#125;} to get this code ready for [[Help:Substitution#Optional_substitution|optional substitution]] into another template.
; Sanity check&#58;
: {{evaldemo/3|{{PAGENAME}}|2007}}, 2007 is no leap year.
: {{evaldemo/3|{{PAGENAME}}|2008}}, 2008 is a leap year.
: {{evaldemo/3|{{PAGENAME}}|2100}}, 2100 is no leap year.
: {{evaldemo/3|{{PAGENAME}}|2400}}, 2400 is a leap year.
: {{evaldemo/3|{{PAGENAME}}|1500}}, [[w:en:Proleptic Gregorian calendar|proleptic Gregorian calendar]].
: {{evaldemo/3|{{PAGENAME}}|-100}} for 101 BC (mostly pointless).
: {{evaldemo/3|{{PAGENAME}}|502*4-8}}, guess why.
 
Results for fractions like {{evaldemo/3|{{PAGENAME}}|2000.9|5==}} are unspecified, even if it apparently gives an "expected" result at the moment this might change without notice.
</noinclude>
interwiki, renameuser, Administrators
13,552
edits