|
|
(4 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | <!--Defining calendar variables:
| + | {{User:Sunmarsh/Sandbox/Green|Bells|777}} |
− | -->{{#vardefine:year|{{{year|{{LOCALYEAR}}}}}
| |
− | }}{{#vardefine:month|{{ucfirst:{{{month|{{LOCALMONTHNAME}}}}}}}
| |
− | }}{{#vardefine:prevmonth|{{#time:F|{{#var:year}}-{{#ifeq:{{#var:month}}|January|12|{{#expr:{{#time:n|{{#var:month}}}} - 1}}}}}}
| |
− | }}{{#vardefine:prevmonthdays|{{#time:t|{{#var:year}} {{#var:prevmonth}}}}
| |
− | }}{{#vardefine:thismonthdays|{{#time:t|{{#var:year}} {{#var:month}}}}
| |
− | }}{{#vardefine:nextmonth|{{#time:F|{{#var:year}}-{{#ifeq:{{#var:month}}|December|1|{{#expr:{{#time:n|{{#var:month}}}} + 1}}}}}}
| |
− | }}{{#vardefine:firstday|{{#time:w|{{{date|1}}} {{#var:month}} {{#var:year}}}}
| |
− | }}{{#vardefine:lastday|{{#time:w|{{#var:thismonthdays}} {{#var:month}} {{#var:year}}}}
| |
− | }}<!--This loop determines the date associated with each 'square' of the calendar:
| |
− | -->{{#loop: count
| |
− | | 0
| |
− | | 43
| |
− | | {{#vardefine:V{{#var:count}}|{{#ifexpr:(({{#var:count}} - {{#var:firstday}}) + 1) < 1 | {{#expr:{{#var:prevmonthdays}} + (({{#var:count}} - {{#var:firstday}}) + 1)}} | {{#ifexpr:{{#var:count}} >= ({{#var:firstday}} + {{#var:thismonthdays}}) | {{#expr:({{#var:count}} - ({{#var:firstday}} + {{#var:thismonthdays}})) + 1}} | {{#expr:(({{#var:count}} - {{#var:firstday}}) + 1)}}}}}}}}
| |
− | }}<!--These variables affect calendar styling:
| |
− | -->{{#vardefine:tablestyle|width{{=}}100% cellspacing=0 style{{=}}"background-color:transparent;"
| |
− | }}{{#vardefine:cellstyle1|height{{=}}125px style{{=}}"padding:0px; border:1px solid #{{ColorSecondary}}; background-color:#
| |
− | }}{{#vardefine:cellstyle2|style{{=}}"padding:2px 0 2px 5px; line-height: 12px; vertical-align: top; text-align: left;" {{!}}
| |
− | }}{{#vardefine:cellstyle3|style{{=}}"height: 97px; line-height: 15px; padding: 0 0 0 3px; vertical-align:top;" {{!}}
| |
− | }}<!--Creating calendar-->
| |
− | {| style="border:4px solid #67AD42; background-color:#{{ColorSecondary}}; {{roundy|10px}};"
| |
− | | style="text-align:center; height:55px;"| {{#ifeq: {{{link|}}}|false||[[{{#var:prevmonth}}|{{Colorshow|000|← {{#var:prevmonth}}}}]]}}
| |
− | ! colspan=5 style="height:55px; padding:5px 0 0 0;"| <big><big><big>{{#var:month}} {{#var:year}}</big></big></big>
| |
− | | style="text-align:center; height:55px;"| {{#ifeq: {{{link|}}}|false||[[{{#var:nextmonth}}|{{Colorshow|000|{{#var:nextmonth}} →}}]]}}
| |
− | |-
| |
− | | colspan=7 style="border-bottom: 2px solid #67AD42;" |
| |
− | |-
| |
− | ! width=125px | <big>Sunday</big>
| |
− | ! width=125px | <big>Monday</big>
| |
− | ! width=125px | <big>Tuesday</big>
| |
− | ! width=125px | <big>Wednesday</big>
| |
− | ! width=125px | <big>Thursday</big>
| |
− | ! width=125px | <big>Friday</big>
| |
− | ! width=125px | <big>Saturday</big>
| |
− | |-
| |
− | | colspan=7 style="padding:0px; border-bottom: 2px solid #67AD42;" |
| |
− | |-
| |
− | |
| |
− | |-
| |
− | | {{#var:cellstyle1}}{{#ifexpr:{{#var:V0}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V0}} > 6 | {{Colorshow|bdbdbd|{{#var:V0}}}} | {{#var:V0}}}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{0|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}{{#ifexpr:{{#var:V1}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V1}} > 6 | {{Colorshow|bdbdbd|{{#var:V1}}}} | {{#var:V1}}}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{01|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}{{#ifexpr:{{#var:V2}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V2}} > 6 | {{Colorshow|bdbdbd|{{#var:V2}}}} | {{#var:V2}}}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{02|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}{{#ifexpr:{{#var:V3}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V3}} > 6 | {{Colorshow|bdbdbd|{{#var:V3}}}} | {{#var:V3}}}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{03|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}{{#ifexpr:{{#var:V4}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V4}} > 6 | {{Colorshow|bdbdbd|{{#var:V4}}}} | {{#var:V4}}}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{04|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}{{#ifexpr:{{#var:V5}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V5}} > 6 | {{Colorshow|bdbdbd|{{#var:V5}}}} | {{#var:V5}}}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{05|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}{{#ifexpr:{{#var:V6}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V6}} > 6 | {{Colorshow|bdbdbd|{{#var:V6}}}} | {{#var:V6}}}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{06|}}}
| |
− | |}
| |
− | |-
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V7}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{07|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V8}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{08|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V9}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{09|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V10}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{10|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V11}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{11|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V12}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{12|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V13}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{13|}}}
| |
− | |}
| |
− | |-
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V14}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{14|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V15}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{15|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V16}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{16|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V17}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{17|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V18}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{18|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V19}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{19|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V20}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{20|}}}
| |
− | |}
| |
− | |-
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V21}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{21|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V22}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{22|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V23}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{23|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V24}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{24|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V25}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{25|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V26}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{26|}}}
| |
− | |}
| |
− | | {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
| |
− | {| {{#var:tablestyle}}
| |
− | | {{#var:cellstyle2}} <big>{{#var:V27}}</big>
| |
− | |-
| |
− | | {{#var:cellstyle3}} {{{27|}}}
| |
− | |}
| |
− | {{#ifexpr:({{#var:thismonthdays}} + {{#var:firstday}} + (6 - {{#var:lastday}})) > 28 |
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V28}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V28}} < 7 | {{Colorshow|bdbdbd|{{#var:V28}}}} | {{#var:V28}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{28|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V29}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V29}} < 7 | {{Colorshow|bdbdbd|{{#var:V29}}}} | {{#var:V29}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{29|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V30}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V30}} < 7 | {{Colorshow|bdbdbd|{{#var:V30}}}} | {{#var:V30}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{30|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V31}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V31}} < 7 | {{Colorshow|bdbdbd|{{#var:V31}}}} | {{#var:V31}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{31|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V32}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V32}} < 7 | {{Colorshow|bdbdbd|{{#var:V32}}}} | {{#var:V32}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{32|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V33}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V33}} < 7 | {{Colorshow|bdbdbd|{{#var:V33}}}} | {{#var:V33}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{33|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V34}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V34}} < 7 | {{Colorshow|bdbdbd|{{#var:V34}}}} | {{#var:V34}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{34|}}}
| |
− | {{!)}}|}}
| |
− | {{#ifexpr:({{#var:thismonthdays}} + {{#var:firstday}} + (6 - {{#var:lastday}})) > 35 |
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V35}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V35}} < 7 | {{Colorshow|bdbdbd|{{#var:V35}}}} | {{#var:V35}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{35|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V36}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V36}} < 7 | {{Colorshow|bdbdbd|{{#var:V36}}}} | {{#var:V36}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{36|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V37}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V37}} < 7 | {{Colorshow|bdbdbd|{{#var:V37}}}} | {{#var:V37}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{37|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V38}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V38}} < 7 | {{Colorshow|bdbdbd|{{#var:V38}}}} | {{#var:V38}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{38|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V39}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V39}} < 7 | {{Colorshow|bdbdbd|{{#var:V39}}}} | {{#var:V39}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{39|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V40}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V40}} < 7 | {{Colorshow|bdbdbd|{{#var:V40}}}} | {{#var:V40}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{40|}}}
| |
− | {{!)}}
| |
− | {{!}} {{#var:cellstyle1}}{{#ifexpr:{{#var:V41}} < 7 | f1f1f1 | ffffff}}; {{roundy|5px}};" {{!}}
| |
− | {{(!}} {{#var:tablestyle}}
| |
− | {{!}} {{#var:cellstyle2}} <big>{{#ifexpr:{{#var:V41}} < 7 | {{Colorshow|bdbdbd|{{#var:V41}}}} | {{#var:V41}}}}</big>
| |
− | {{!-}}
| |
− | {{!}} {{#var:cellstyle3}} {{{41|}}}
| |
− | {{!)}}|}}
| |
− | |}<noinclude>
| |
− | | |
− | Calculate the difference between calendar value x and the start date value (numeral associated with the day of the week the month starts on), and add 1. If the result of this expression is less than one, then the calendar value is part of the previous month. For these calendar values, take the number of days in the previous month and add to them the result of the following expression: calendar value x - the start date value + 1. If the result of the expression in the first sentence is 1 or greater then determine if calendar value x is equal to or greater than the sum of the number of days in the current month and the start date value. If so, then the calendar value is part of the following month. For these calendar values, subtract the sum of the number of days in the current month and the start date value from calendar value x and add 1. For all other values (the calendar values associated with the days of the current month), calculate the difference between calendar value x and the start date value and add 1.
| |
− | | |
− | To determine whether or not the calendar should display a given week, find the sum of these variables: the number of days in the current month, the start date value, and six minus the end date value. Whether or not the week is displayed is dependent on whether this value exceeds 28 (for a fifth week), and then 35 (for a sixth week).
| |