Difference between revisions of "Template:CalFillFebruary"

From Nookipedia, the Animal Crossing wiki
(Template completed, coding notes added)
 
(Fixed code to display Festivale date in 2016 and 2022)
Line 9: Line 9:
 
|06 = {{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Monday = <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Annalisa]]'s birthday</li></ul></small> | Wednesday | Thursday | Friday | Saturday | Sunday = <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Annalisa]]'s birthday</li></ul></small>|<small><ul><li>[[Annalisa]]'s birthday</li></ul></small>}}
 
|06 = {{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Monday = <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Annalisa]]'s birthday</li></ul></small> | Wednesday | Thursday | Friday | Saturday | Sunday = <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Annalisa]]'s birthday</li></ul></small>|<small><ul><li>[[Annalisa]]'s birthday</li></ul></small>}}
 
|07 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Sunday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Boomer]]'s birthday</li></ul></small>| <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Boomer]]'s birthday</li></ul></small>}}
 
|07 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Sunday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Boomer]]'s birthday</li></ul></small>| <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Boomer]]'s birthday</li></ul></small>}}
|08 = {{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Saturday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2021 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}} <small><ul><li>[[Frobert]]'s birthday</li></ul></small> | Tuesday | Wednesday | Thursday | Friday | Sunday = <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2021 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Frobert]]'s birthday</li></ul></small>|<small><ul><li>[[Frobert]]'s birthday</li></ul></small>}} | {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2021 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center><small><ul><li>[[Frobert]]'s birthday</li></ul></small>|<small><ul><li>[[Frobert]]'s birthday</li></ul></small>}}}}
+
|08 = {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2016 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}{{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Saturday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2021 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}} <small><ul><li>[[Frobert]]'s birthday</li></ul></small> | Tuesday | Wednesday | Thursday | Friday | Sunday = <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2021 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Frobert]]'s birthday</li></ul></small>|<small><ul><li>[[Frobert]]'s birthday</li></ul></small>}} | {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2021 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center><small><ul><li>[[Frobert]]'s birthday</li></ul></small>|<small><ul><li>[[Frobert]]'s birthday</li></ul></small>}}}}
 
|09 = {{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Friday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Flora]]'s birthday</li><li>[[Blanca]]'s birthday</li></ul></small> | Tuesday | Wednesday | Thursday | Saturday = <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Flora]]'s birthday</li><li>[[Blanca]]'s birthday</li></ul></small>|<small><ul><li>[[Flora]]'s birthday</li><li>[[Blanca]]'s birthday</li></ul></small>}}
 
|09 = {{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Friday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Flora]]'s birthday</li><li>[[Blanca]]'s birthday</li></ul></small> | Tuesday | Wednesday | Thursday | Saturday = <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Flora]]'s birthday</li><li>[[Blanca]]'s birthday</li></ul></small>|<small><ul><li>[[Flora]]'s birthday</li><li>[[Blanca]]'s birthday</li></ul></small>}}
 
|10 = {{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Thursday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Stitches]]' birthday</li></ul></small> | Tuesday | Wednesday | Friday = <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Stitches]]' birthday</li></ul></small>|<small><ul><li>[[Stitches]]' birthday</li></ul></small>}}
 
|10 = {{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Thursday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Stitches]]' birthday</li></ul></small> | Tuesday | Wednesday | Friday = <center>'''[[Bright Nights]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Stitches]]' birthday</li></ul></small>|<small><ul><li>[[Stitches]]' birthday</li></ul></small>}}
Line 29: Line 29:
 
|26 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Wednesday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center><small><ul><li>[[Sheldon]]'s birthday</li></ul></small>|<small><ul><li>[[Sheldon]]'s birthday</li></ul></small>}}
 
|26 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Wednesday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center><small><ul><li>[[Sheldon]]'s birthday</li></ul></small>|<small><ul><li>[[Sheldon]]'s birthday</li></ul></small>}}
 
|27 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Tuesday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center>{{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2017 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Rosie]]'s birthday</li></ul></small>|<small><ul><li>[[Rosie]]'s birthday</li></ul></small>}}|{{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2017 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Rosie]]'s birthday</li></ul></small>|<small><ul><li>[[Rosie]]'s birthday</li></ul></small>}}}}
 
|27 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Tuesday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center>{{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2017 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Rosie]]'s birthday</li></ul></small>|<small><ul><li>[[Rosie]]'s birthday</li></ul></small>}}|{{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2017 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Rosie]]'s birthday</li></ul></small>|<small><ul><li>[[Rosie]]'s birthday</li></ul></small>}}}}
|28 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Monday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Naomi]]'s birthday</li></ul></small>|<small><ul><li>[[Naomi]]'s birthday</li></ul></small>}}
+
|28 = {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2022 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}{{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Monday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Naomi]]'s birthday</li></ul></small>|<small><ul><li>[[Naomi]]'s birthday</li></ul></small>}}
 
|29 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Sunday | <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Leap Day]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Luna]]'s birthday</li></ul></small>|<center>'''[[Leap Day]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Luna]]'s birthday</li></ul></small>}}
 
|29 = {{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Sunday | <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Leap Day]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Luna]]'s birthday</li></ul></small>|<center>'''[[Leap Day]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Luna]]'s birthday</li></ul></small>}}
 
}}<noinclude>
 
}}<noinclude>

Revision as of 18:00, December 27, 2016

← January February 2024 March →
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
28
29
30
Groundhog Day (AC/CF/NL)
31
Flea Market (WW)
1
2
Bright Nights (WW)
3
Bright Nights (WW)
4
Bright Nights (WW)
5
Bright Nights (WW)
6
Bright Nights (WW)
7
Fishing Tourney (CF/NL)
Bright Nights (WW)
8
Bright Nights (WW)
9
Festivale (CF/NL)
10
11
Valentine's Day (AC/CF/NL)
12
13
14
15
16
17
18
19
20
21
22
Flea Market (CF)
Fishing Tourney (WW)
23
24
25
26
Leap Day (CF/NL)
27
28
29
1
2

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 February {{{year|{{LOCALYEAR}}}}}}} | Tuesday |...

    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,

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

    however the logic is essentially the same.


  • The calculation of Festivale's date is particularly difficult in that it varies based on Easter, which is determined by a lunisolar calendar. Rather than attempt to calculate Easter's date in a given year and from that value calculate Festivale's date (which is 48 days before Easter), I instead researched Festivale's date for the next 11 years and had the template check if {{{year|{{LOCALYEAR}}}}} matched for that date:

    |27 = {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2017 |...

    This is much easier, however it means that the template must be updated sometime in the future to show the correct dates for Festivale in 2028 onward.