Difference between revisions of "Template:Calendar"

From Twilight Heroes Wiki
Jump to: navigation, search
(Testing)
 
m (Learned a new trick to avoid whitespace)
 
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
<!-- Variable definitions -->
+
<!-- Variable definitions -->{{
{{#vardefine:st|{{#switch:{{{start|?}}}||?=1|#default={{{start}}}}}}}
+
#vardefine:sr|{{#switch:{{{start|?}}}||?=1|#default={{{start}}}}}}}{{
{{#vardefine:len|{{#switch:{{{mlen|?}}}||?=31|#default={{{mlen}}}}}}}
+
#vardefine:len|{{#switch:{{{mlen|?}}}||?=31|#default={{{mlen}}}}}}}{{
{{#vardefine:mb|{{#switch:{{{mbg|?}}}||?=white|#default={{{mbg}}}}}}}
+
#vardefine:mb|{{#switch:{{{mbg|?}}}||?=white|#default={{{mbg}}}}}}}{{
{{#vardefine:mt|{{#switch:{{{mtx|?}}}||?=black|#default={{{mtx}}}}}}}
+
#vardefine:mt|{{#switch:{{{mtx|?}}}||?=black|#default={{{mtx}}}}}}}{{
{{#vardefine:db|{{#switch:{{{dbg|?}}}||?=white|#default={{{dbg}}}}}}}
+
#vardefine:db|{{#switch:{{{dbg|?}}}||?=white|#default={{{dbg}}}}}}}{{
{{#vardefine:dt|{{#switch:{{{dtx|?}}}||?=white|#default={{{dtx}}}}}}}
+
#vardefine:dt|{{#switch:{{{dtx|?}}}||?=black|#default={{{dtx}}}}}}}
{{#vardefine:fb|{{#switch:{{{fbg|?}}}||?=white|#default={{{fbg}}}}}}}
+
{{#vardefine:fb|{{#switch:{{{fbg|?}}}||?=white|#default={{{fbg}}}}}}}{{
{{#vardefine:ft|{{#switch:{{{ftx|?}}}||?=white|#default={{{ftx}}}}}}}
+
#vardefine:ft|{{#switch:{{{ftx|?}}}||?=black|#default={{{ftx}}}}}}}{{
{{#vardefine:sb|{{#switch:{{{sbg|?}}}||?=white|#default={{{sbg}}}}}}}
+
#vardefine:sb|{{#switch:{{{sbg|?}}}||?=white|#default={{{sbg}}}}}}}{{
{{#vardefine:st|{{#switch:{{{stx|?}}}||?=white|#default={{{stx}}}}}}}
+
#vardefine:st|{{#switch:{{{stx|?}}}||?=black|#default={{{stx}}}}}}}{{
{{#vardefine:cb|{{#switch:{{{bg|?}}}||?=white|#default={{{bg}}}}}}}
+
#vardefine:cb|{{#switch:{{{bg|?}}}||?=white|#default={{{bg}}}}}}}{{
{{#vardefine:ct|{{#switch:{{{tx|?}}}||?=white|#default={{{tx}}}}}}}
+
#vardefine:ct|{{#switch:{{{tx|?}}}||?=black|#default={{{tx}}}}}}}{{
 
+
#vardefine:n|{{#expr:-{{#var:sr}}+2}}}}{{#vardefine:my|{{{month}}} {{{year}}}}}
 
<!-- Actual thing -->
 
<!-- Actual thing -->
 
 
{| cellpadding="5" cellspacing="1" border="1" align="center" style="text-align:center"
 
{| cellpadding="5" cellspacing="1" border="1" align="center" style="text-align:center"
 
|-
 
|-
! colspan="6" style="background:{{#var:mb}}; color:{{#var:mt}}" | {{{Month}}} {{{Year}}}
+
! colspan="6" style="background:{{#var:mb}}; color:{{#var:mt}}" | {{#var:my}}
|- style="background:color:{{#var:db}}; color:color:{{#var:dt}}"
+
|- style="background:{{#var:db}}; color:{{#var:dt}}"
 
! style="width:75px" | Sunday
 
! style="width:75px" | Sunday
 
! style="width:75px" | Moonday
 
! style="width:75px" | Moonday
Line 27: Line 26:
 
! style="width:75px" | Frayday
 
! style="width:75px" | Frayday
 
|-
 
|-
{{#for:{{#expr:{{#var:st}}-1}}||{{CalCell||||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}
+
|{{CalCell|{{#ifexpr:{{#var:n}}>0|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
|}</includeonly>
+
|{{CalCell|{{#ifexpr:{{#var:n}}>0|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}>0|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}>0|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}>0|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:fb}}|{{#var:ft}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|-
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:fb}}|{{#var:ft}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|-
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:fb}}|{{#var:ft}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|-
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:fb}}|{{#var:ft}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|-
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#var:n}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:fb}}|{{#var:ft}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|-
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:cb}}|{{#var:ct}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|{{CalCell|{{#ifexpr:{{#var:n}}<={{#var:len}}|{{#var:n}}|&nbsp;}}|{{#var:my}}||{{#var:sb}}|{{#var:st}}|{{#var:fb}}|{{#var:ft}}}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}
 +
|}</includeonly><noinclude>[[Category:Utility Templates|{{PAGENAME}}]]</noinclude>

Latest revision as of 09:24, 8 March 2010