Difference between revisions of "User:Sunmarsh/Sandbox/Orange"

From Nookipedia, the Animal Crossing wiki
m (Working on cell background color/date label.)
(Variables created for cell and table styles. Coding for calendar complete through week 4.)
Line 11: Line 11:
 
  | {{#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)}}}}}}}}
 
  | {{#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)}}}}}}}}
 
}}
 
}}
 +
{{#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;" {{!}}}}
  
 
{| style="border:4px solid #{{ColorPrimary}}; background-color:#{{ColorSecondary}}; {{roundy|10px}};"
 
{| style="border:4px solid #{{ColorPrimary}}; background-color:#{{ColorSecondary}}; {{roundy|10px}};"
Line 31: Line 35:
 
|
 
|
 
|-
 
|-
| height=125px style="padding:0px; border:1px solid #{{ColorSecondary}}; background-color:#{{#ifexpr:{{#var:V0}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" | {{#ifeq: {{#time:l|{{{month|{{LOCALMONTHNAME}}}}} 1 {{{year|{{LOCALYEAR}}}}}}} | Sunday |  
+
| {{#var:cellstyle1}}{{#ifexpr:{{#var:V0}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};"
{{(!}} width{{=}}100% cellspacing=0 style{{=}}"background-color:transparent;"
+
{| {{#var:tablestyle}}
{{!}} style{{=}}"padding:2px 0 2px 5px; line-height: 12px; vertical-align: top; text-align: left;" {{!}} <big>{{#var:V0}}</big>
+
| {{#var:cellstyle2}} <big>{{#var:V0}}</big>
{{!-}}
+
|-
{{!}} style{{=}}"height: 97px; line-height: 15px; padding: 0 0 0 3px; vertical-align:top;" {{!}} {{{01|}}}
+
| {{#var:cellstyle3}} {{{0|}}}
{{!)}}
+
|}
 +
| {{#var:cellstyle1}}{{#ifexpr:{{#var:V1}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V1}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{1|}}}
 +
|}
 +
| {{#var:cellstyle1}}{{#ifexpr:{{#var:V2}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V2}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{2|}}}
 +
|}
 +
| {{#var:cellstyle1}}{{#ifexpr:{{#var:V3}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V3}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{3|}}}
 +
|}
 +
| {{#var:cellstyle1}}{{#ifexpr:{{#var:V4}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V4}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{4|}}}
 +
|}
 +
| {{#var:cellstyle1}}{{#ifexpr:{{#var:V5}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V5}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{5|}}}
 +
|}
 +
| {{#var:cellstyle1}}{{#ifexpr:{{#var:V6}} > 6 | f1f1f1 | ffffff}}; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V6}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{6|}}}
 +
|}
 +
|-
 +
| {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V7}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{7|}}}
 +
|}
 +
| {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V8}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{8|}}}
 +
|}
 +
| {{#var:cellstyle1}}ffffff; {{roundy|5px}};" |
 +
{| {{#var:tablestyle}}
 +
| {{#var:cellstyle2}} <big>{{#var:V9}}</big>
 +
|-
 +
| {{#var:cellstyle3}} {{{9|}}}
 +
|}
 +
| {{#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|}}}
 +
|}
 
|}
 
|}
  

Revision as of 14:00, January 7, 2021







← September October 2024 November →
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26


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).