Difference between revisions of "Template:CalFillJanuary"

From Nookipedia, the Animal Crossing wiki
(Who the hell thought that Fishing Tourney falls on a Sunday for CF/NL?)
(Revised some code. Functionality should remain.)
Line 9: Line 9:
 
|06 = <small><ul><li>[[Carmen]]'s birthday</li><li>[[Felyne]]'s birthday</li></ul></small>
 
|06 = <small><ul><li>[[Carmen]]'s birthday</li><li>[[Felyne]]'s birthday</li></ul></small>
 
|07 = <small><ul><li>[[Harry]]'s birthday</li></ul></small>
 
|07 = <small><ul><li>[[Harry]]'s birthday</li></ul></small>
|08 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 8 | <center>'''[[La-Di-Day]]'''(<small>{{WW|shortest|nolink}}</small>)</center> <small><ul><li>[[Pierce]]'s birthday</li><li>[[Joan]]'s birthday</li></ul></small>|<small><ul><li>[[Pierce]]'s birthday</li><li>[[Joan]]'s birthday</li></ul></small>}}
+
|08 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Saturday = <center>'''[[La-Di-Day]]'''(<small>{{WW|shortest|nolink}}</small>)</center>}} <small><ul><li>[[Pierce]]'s birthday</li><li>[[Joan]]'s birthday</li></ul></small>
|09 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 9 | <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Tiffany]]'s birthday</li></ul></small>|<small><ul><li>[[Tiffany]]'s birthday</li></ul></small>}}
+
|09 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Friday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center>}} <small><ul><li>[[Tiffany]]'s birthday</li></ul></small>
|10 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 10 | <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Poppy]]'s birthday</li></ul></small>|<small><ul><li>[[Poppy]]'s birthday</li></ul></small>}}
+
|10 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Thursday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center>}} <small><ul><li>[[Poppy]]'s birthday</li></ul></small>
|11 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 11 | <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Maddie]]'s birthday</li></ul></small>|<small><ul><li>[[Maddie]]'s birthday</li></ul></small>}}
+
|11 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Wednesday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center>}} <small><ul><li>[[Maddie]]'s birthday</li></ul></small>
|12 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 12 | <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Moe]]'s birthday</li></ul></small>|<small><ul><li>[[Moe]]'s birthday</li></ul></small>}}
+
|12 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center>}} <small><ul><li>[[Moe]]'s birthday</li></ul></small>
|13 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 13 | <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Puddles]]'s birthday</li></ul></small>|<small><ul><li>[[Puddles]]'s birthday</li></ul></small>}}
+
|13 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Monday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center>}} <small><ul><li>[[Puddles]]'s birthday</li></ul></small>
|14 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 14 | <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Velma]]'s birthday</li></ul></small>|<small><ul><li>[[Velma]]'s birthday</li></ul></small>}}
+
|14 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center>}} <small><ul><li>[[Velma]]'s birthday</li></ul></small>
|15 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Saturday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Gladys]]' birthday</li></ul></small>|<small><ul><li>[[Gladys]]' birthday</li></ul></small>}}
+
|15 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Saturday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}<small><ul><li>[[Gladys]]' birthday</li></ul></small>
|16 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Friday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Ursula]]'s birthday</li></ul></small>|<small><ul><li>[[Ursula]]'s birthday</li></ul></small>}}
+
|16 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Friday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}<small><ul><li>[[Ursula]]'s birthday</li></ul></small>
|17 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Thursday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Rizzo]]'s birthday</li></ul></small>|<small><ul><li>[[Rizzo]]'s birthday</li></ul></small>}}
+
|17 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Thursday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}<small><ul><li>[[Rizzo]]'s birthday</li></ul></small>
|18 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Wednesday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Chelsea]]'s birthday</li></ul></small>|<small><ul><li>[[Chelsea]]'s birthday</li></ul></small>}}
+
|18 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Wednesday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}<small><ul><li>[[Chelsea]]'s birthday</li></ul></small>
|19 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Simon]]'s birthday</li></ul></small>|<small><ul><li>[[Simon]]'s birthday</li></ul></small>}}
+
|19 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}<small><ul><li>[[Simon]]'s birthday</li></ul></small>
|20 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Monday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Opal]]'s birthday</li></ul></small>|<small><ul><li>[[Opal]]'s birthday</li></ul></small>}}
+
|20 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Monday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}<small><ul><li>[[Opal]]'s birthday</li></ul></small>
|21 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Genji]]'s birthday</li></ul></small>|<small><ul><li>[[Genji]]'s birthday</li></ul></small>}}
+
|21 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}}/{{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}<small><ul><li>[[Genji]]'s birthday</li></ul></small>
 
|22 = <small><ul><li>[[Francine]]'s birthday</li></ul></small>
 
|22 = <small><ul><li>[[Francine]]'s birthday</li></ul></small>
 
|23 = <small><ul><li>[[Gwen]]'s birthday</li></ul></small>
 
|23 = <small><ul><li>[[Gwen]]'s birthday</li></ul></small>
 
|24 = <small><ul><li>[[Rhonda]]'s birthday</li></ul></small>
 
|24 = <small><ul><li>[[Rhonda]]'s birthday</li></ul></small>
|25 = {{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Thursday | <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Savannah]]'s birthday</li></ul></small> | <small><ul><li>[[Savannah]]'s birthday</li></ul></small>}}
+
|25 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Thursday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center>}} <small><ul><li>[[Savannah]]'s birthday</li></ul></small>
|26 = {{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Wednesday | <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Vivian]]'s birthday</li><li>[[Cyrus]]' birthday</li></ul></small>|<small><ul><li>[[Vivian]]'s birthday</li><li>[[Cyrus]]' birthday</li></ul></small>}}
+
|26 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Wednesday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center>}} <small><ul><li>[[Vivian]]'s birthday</li><li>[[Cyrus]]' birthday</li></ul></small>
|27 = {{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday | <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Aurora]]'s birthday</li><li>[[Admiral]]'s birthday</li></ul></small>|<small><ul><li>[[Aurora]]'s birthday</li><li>[[Admiral]]'s birthday</li></ul></small>}}
+
|27 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center>}} <small><ul><li>[[Aurora]]'s birthday</li><li>[[Admiral]]'s birthday</li></ul></small>
|28 = {{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Monday | <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Margie]]'s birthday</li></ul></small>|<small><ul><li>[[Margie]]'s birthday</li></ul></small>}}
+
|28 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Monday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center>}} <small><ul><li>[[Margie]]'s birthday</li></ul></small>
|29 = {{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday | <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Cube]]'s birthday</li></ul></small>|<small><ul><li>[[Cube]]'s birthday</li></ul></small>}}
+
|29 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center>}} <small><ul><li>[[Cube]]'s birthday</li></ul></small>
|30 = {{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Saturday | <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Flurry]]'s birthday</li></ul></small>|<small><ul><li>[[Flurry]]'s birthday</li></ul></small>}}
+
|30 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Saturday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center>}} <small><ul><li>[[Flurry]]'s birthday</li></ul></small>
|31 = {{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Friday | <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Winnie]]'s birthday</li><li>[[Harriet]]'s birthday</li></ul></small>|<small><ul><li>[[Winnie]]'s birthday</li><li>[[Harriet]]'s birthday</li></ul></small>}}
+
|31 = {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Friday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small><br> '''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center>}} <small><ul><li>[[Winnie]]'s birthday</li><li>[[Harriet]]'s birthday</li></ul></small>
 
}}<noinclude>
 
}}<noinclude>
 
==Usage==
 
==Usage==
 
This template is used to automatically generate and populate a template call for [[Template:Calendar]] for the month of [[January]] for the year specified. If no year is provided, the current year will be used.
 
This template is used to automatically generate and populate a template call for [[Template:Calendar]] for the month of [[January]] for the year specified. If no year is provided, the current year will be used.
 
==Coding notes==
 
==Coding notes==
*The template determines when a non-date specific event (e.g. fourth Thursday in November) occurs by using the following formula for each possible date that event could occur on: <blockquote><tt><nowiki>{{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday |...</nowiki></tt></blockquote> In this example, the template is checking to see if the first day of February was a Tuesday, and if so it will insert information about the event (represented by "..." in this example). If an event lasts for more than one day (e.g. [[Bright Nights]]) a #switch function is used instead, <blockquote><tt><nowiki>{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday | Wednesday =...</nowiki></tt></blockquote> however the logic is essentially the same.
+
*The template determines when a non-date specific event (e.g. fourth Thursday in November) occurs by using the following formula for each possible date that event could occur on: <blockquote><tt><nowiki>{{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday |...}}</nowiki></tt></blockquote> In this example, the template is checking to see if the first day of January was a Tuesday, and if so it will insert information about the event (represented by "..." in this example). If an event lasts for more than one day (e.g. [[Bright Nights]]) a #switch function is used instead, <blockquote><tt><nowiki>{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday | Wednesday =...</nowiki></tt></blockquote> however the logic is essentially the same. The usage of <tt>#switch</tt> is recommended for its extendibility (e.g., for multiple events occuring within the week).
<br>
 
 
*This template also uses an alternate formula where days of the week are assigned a value between 1 and 7, and then this value is added to some constant to determine whether or not an event is to occur on a given day: <blockquote><tt><nowiki>|08 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 8 |...</nowiki></tt></blockquote> This format was abandoned in favor of the initial formula for its brevity.
 
*This template also uses an alternate formula where days of the week are assigned a value between 1 and 7, and then this value is added to some constant to determine whether or not an event is to occur on a given day: <blockquote><tt><nowiki>|08 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 8 |...</nowiki></tt></blockquote> This format was abandoned in favor of the initial formula for its brevity.

Revision as of 23:39, January 23, 2019

← December January 2024 February →
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
31
1
New Year's Day
2
3
4
5
6
7
8
9
10
11
12
13
La-Di-Day (WW)
14
15
16
17
18
19
20
Fishing Tourney (WW/CF/NL)
21
22
23
24
25
26
27
28
Yay Day (WW)
Flea Market (CF)
29
30
31
1
2
3

Usage

This template is used to automatically generate and populate a template call for Template:Calendar for the month of January for the year specified. If no year is provided, the current year will be used.

Coding notes

  • The template determines when a non-date specific event (e.g. fourth Thursday in November) occurs by using the following formula for each possible date that event could occur on:

    {{#ifeq: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday |...}}

    In this example, the template is checking to see if the first day of January was a Tuesday, and if so it will insert information about the event (represented by "..." in this example). If an event lasts for more than one day (e.g. Bright Nights) a #switch function is used instead,

    {{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Tuesday | Wednesday =...

    however the logic is essentially the same. The usage of #switch is recommended for its extendibility (e.g., for multiple events occuring within the week).
  • This template also uses an alternate formula where days of the week are assigned a value between 1 and 7, and then this value is added to some constant to determine whether or not an event is to occur on a given day:

    |08 = {{#ifeq: {{#expr: 7+{{#switch: {{#time:l|01 January {{{year|{{LOCALYEAR}}}}}}} | Sunday = 7| Monday = 6| Tuesday = 5| Wednesday = 4| Thursday = 3| Friday = 2| Saturday = 1|}}}}| 8 |...

    This format was abandoned in favor of the initial formula for its brevity.