Difference between revisions of "Template:CalFillMarch"

From Nookipedia, the Animal Crossing wiki
m
(Template completed, coding notes added)
Line 2: Line 2:
 
|year = {{{year|{{LOCALYEAR}}}}}
 
|year = {{{year|{{LOCALYEAR}}}}}
 
|month = March
 
|month = March
|01 = <small><ul><li>[[Bill]]'s birthday</li><li>[[Rover]]'s birthday</li></ul></small>
+
|01 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Saturday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Coco]]'s birthday</li></ul></small>|<small><ul><li>[[Coco]]'s birthday</li></ul></small>}}
|02 = <small><ul><li>[[Jitters]]'s birthday</li></ul></small>
+
|02 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Friday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Barold]]'s birthday</li></ul></small>|<small><ul><li>[[Barold]]'s birthday</li></ul></small>}}
|03 = <small><ul><li>[[Olivia]]'s birthday</li></ul></small>
+
|03 = {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2025 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}} <center>'''[[Girl's Festival]]''' <small>({{CF|shortest|nolink}})</small></center> {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Thursday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Bonbon]]'s birthday</li></ul></small>|<small><ul><li>[[Bonbon]]'s birthday</li></ul></small>}}
|04 = <small><ul><li>[[Lily]]'s birthday</li></ul></small>
+
|04 = {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2019 | <center>'''[[Festivale]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center>}}{{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Wednesday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Anchovy]]'s birthday</li></ul></small>|<small><ul><li>[[Anchovy]]'s birthday</li></ul></small>}}
|05 = <small><ul><li>[[Penelope]]'s birthday</li></ul></small>
+
|05 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Tuesday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Gala]]'s birthday</li></ul></small>|<small><ul><li>[[Gala]]'s birthday</li></ul></small>}}
|06 = <small><ul><li>[[Annalisa]]'s birthday</li></ul></small>
+
|06 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Monday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Chevre]]'s birthday</li><li>[[Chai]]'s birthday</li></ul></small>|<small><ul><li>[[Chevre]]'s birthday</li><li>[[Chai]]'s birthday</li></ul></small>}}
|07 = <small><ul><li>[[Boomer]]'s birthday</li></ul></small>
+
|07 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Sunday | <center>'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Molly]]'s birthday</li></ul></small>|<small><ul><li>[[Molly]]'s birthday</li></ul></small>}}
|08 = <small><ul><li>[[Frobert]]'s birthday</li></ul></small>
+
|08 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Sunday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Zucker]]'s birthday</li><li>[[Pete]]'s birthday</li></ul></small> | Saturday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Zucker]]'s birthday</li><li>[[Pete]]'s birthday</li></ul></small>|<small><ul><li>[[Zucker]]'s birthday</li><li>[[Pete]]'s birthday</li></ul></small>}}
|09 = <small><ul><li>[[Flora]]'s birthday</li></ul></small>
+
|09 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Saturday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Cyrano]]'s birthday</li></ul></small> | Friday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Cyrano]]'s birthday</li></ul></small>|<small><ul><li>[[Cyrano]]'s birthday</li></ul></small>}}
|10 = <small><ul><li>[[Stitches]]' birthday</li></ul></small>
+
|10 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Friday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> | Thursday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center>}}
|11 = <small><ul><li>[[Pompom]]'s birthday</li></ul></small>
+
|11 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Thursday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Hopkins]]'s birthday</li></ul></small> | Wednesday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Hopkins]]'s birthday</li></ul></small>|<small><ul><li>[[Hopkins]]'s birthday</li></ul></small>}}
|12 = <small><ul><li>[[Drago]]'s birthday</li></ul></small>
+
|12 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Wednesday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Midge]]'s birthday</li></ul></small> | Tuesday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Midge]]'s birthday</li></ul></small>|<small><ul><li>[[Midge]]'s birthday</li></ul></small>}}
|13 = <small><ul><li>[[Ribbot]]'s birthday</li></ul></small>
+
|13 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Tuesday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> | Monday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center>}}
|14 = <small><ul><li>[[Muffy]]'s birthday</li></ul></small>
+
|14 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Monday = <center>'''[[Fishing Tourney]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Girl's Festival]]''' <small>({{DnM|shortest|nolink}})</small></center> <small><ul><li>[[Dotty]]'s birthday</li></ul></small> | Sunday = <center>'''[[La-Di-Day]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Girl's Festival]]''' <small>({{DnM|shortest|nolink}})</small></center> <small><ul><li>[[Dotty]]'s birthday</li></ul></small>|<center>'''[[Girl's Festival]]''' <small>({{DnM|shortest|nolink}})</small></center> <small><ul><li>[[Dotty]]'s birthday</li></ul></small>}}
|15 = <small><ul><li>[[Kitty]]'s birthday</li></ul></small>
+
|15 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Saturday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Julian]]'s birthday</li></ul></small> | Sunday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Julian]]'s birthday</li></ul></small>|<small><ul><li>[[Julian]]'s birthday</li></ul></small>}}
|16 = <small><ul><li>[[Anabelle]]'s birthday</li></ul></small>
+
|16 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Friday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Doc]]'s birthday</li></ul></small>| Saturday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Doc]]'s birthday</li></ul></small>|<small><ul><li>[[Doc]]'s birthday</li></ul></small>}}
|17 = <small><ul><li>[[Dobie]]'s birthday</li></ul></small>
+
|17 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Thursday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Cheri]]'s birthday</li></ul></small> | Friday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Cheri]]'s birthday</li></ul></small>|<small><ul><li>[[Cheri]]'s birthday</li></ul></small>}}
|18 = <small><ul><li>[[Dora]]'s birthday</li></ul></small>
+
|18 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Wednesday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> | Thursday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small></center>}}
|19 = <small><ul><li>[[Freckles]]' birthday</li></ul></small>
+
|19 = <center>'''[[Father's Day]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}}) {{NA}}</small></center> {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Tuesday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <small><ul><li>[[Merengue]]'s birthday</li><li>[[Pelly]]'s birthday</li></ul></small>| Wednesday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small></center> <small><ul><li>[[Merengue]]'s birthday</li><li>[[Pelly]]'s birthday</li></ul></small> | <small><ul><li>[[Merengue]]'s birthday</li><li>[[Pelly]]'s birthday</li></ul></small>}}
|20 = <small><ul><li>[[Sprinkle]]'s birthday</li></ul></small>
+
|20 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Monday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <center>'''[[Spring Sports Fair]]''' <small>({{PG|shortest|nolink}})</small></center> <small><ul><li>[[Hornsby]]'s birthday</li></ul></small>| Tuesday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Spring Sports Fair]]''' <small>({{PG|shortest|nolink}})</small></center> <small><ul><li>[[Hornsby]]'s birthday</li></ul></small>|<center>'''[[Spring Sports Fair]]''' <small>({{PG|shortest|nolink}})</small></center> <small><ul><li>[[Hornsby]]'s birthday</li></ul></small>}}
|21 = <small><ul><li>[[Puck]]'s birthday</li></ul></small>
+
|21 = {{#switch: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Sunday = <center>'''[[Fishing Tourney]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}})</small></center> <center>'''[[Spring Sports Fair]]''' <small>({{PG|shortest|nolink}})</small></center><small><ul><li>[[Elise]]'s birthday</li></ul></small>| Monday = <center>'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small></center> <center>'''[[Spring Sports Fair]]''' <small>({{PG|shortest|nolink}})</small></center><small><ul><li>[[Elise]]'s birthday</li></ul></small>|<center>'''[[Spring Sports Fair]]''' <small>({{PG|shortest|nolink}})</small></center><small><ul><li>[[Elise]]'s birthday</li></ul></small>}}
|22 = <small><ul><li>[[Avery]]'s birthday</li></ul></small>
+
|22 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Sunday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Paula]]'s birthday</li></ul></small>|<small><ul><li>[[Paula]]'s birthday</li></ul></small>}}
|23 = <small><ul><li>[[Pate]]'s birthday</li></ul></small>
+
|23 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Saturday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Axel]]'s birthday</li></ul></small>|<small><ul><li>[[Axel]]'s birthday</li></ul></small>}}
|24 = <small><ul><li>[[Anicotti]]'s birthday</li></ul></small>
+
|24 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Friday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Skye]]'s birthday</li></ul></small>|<small><ul><li>[[Skye]]'s birthday</li></ul></small>}}
|25 = <small><ul><li>[[Hamphrey]]'s birthday</li></ul></small>
+
|25 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Thursday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Celia]]'s birthday</li><li>[[Billy]]'s birthday</li></ul></small>|<small><ul><li>[[Celia]]'s birthday</li><li>[[Billy]]'s birthday</li></ul></small>}}
|26 = <small><ul><li>[[Sheldon]]'s birthday</li></ul></small>
+
|26 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Wednesday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Fauna]]'s birthday</li><li>[[Louie]]'s birthday</li></ul></small>|<small><ul><li>[[Fauna]]'s birthday</li><li>[[Louie]]'s birthday</li></ul></small>}}
|27 = <small><ul><li>[[Rosie]]'s birthday</li></ul></small>
+
|27 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Tuesday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Lolly]]'s birthday</li></ul></small>|<small><ul><li>[[Lolly]]'s birthday</li></ul></small>}}
|28 = <small><ul><li>[[Naomi]]'s birthday</li></ul></small>
+
|28 = {{#ifeq: {{#time:l|01 March {{{year|{{LOCALYEAR}}}}}}} | Monday | <center>'''[[Flea Market]]''' <small>({{CF|shortest|nolink}})</small></center> <small><ul><li>[[Baabara]]'s birthday</li></ul></small>|<small><ul><li>[[Baabara]]'s birthday</li></ul></small>}}
|29 = <small><ul><li>[[Cube]]'s birthday</li></ul></small>
+
|29 = <small><ul><li>[[Biff]]'s birthday</li></ul></small>
|30 = <small><ul><li>[[Flurry]]'s birthday</li></ul></small>
+
|30 = <small><ul><li>[[Felicity]]'s birthday</li></ul></small>
|31 = {{#ifeq: {{#time:l|01 March {{{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 = <small><ul><li>[[Klaus]]'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 [[March]] 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 [[March]] 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: <blockquote><tt><nowiki>{{#ifeq: {{#time:l|01 February {{{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 February {{{year|{{LOCALYEAR}}}}}}} | Tuesday | Wednesday =...</nowiki></tt></blockquote> however the logic is essentially the same.
 +
<br>
 +
*The calculation of [[Festivale]]'s date is particularly difficult in that it varies based on [[wikipedia:Easter|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 <tt><nowiki>{{{year|{{LOCALYEAR}}}}}</nowiki></tt> matched for that date:<blockquote><tt><nowiki>|27 = {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2017 |...</nowiki></tt></blockquote>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.

Revision as of 18:00, December 27, 2016

← February March 2024 April →
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
25
26
27
Flea Market (WW)
28
Girl's Festival (CF)
29
1
2
3
4
5
La-Di-Day (WW)
6
Fishing Tourney (WW)
7
8
9
10
Girl's Festival (DnM)
11
12
Fishing Tourney (CF/NL)
13
Yay Day (WW)
14
15
Father's Day (CF/NL) Template:NA
16
Spring Sports Fair (AC)
17
Spring Sports Fair (AC)
18
19
20
Flea Market (CF)
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6

Usage

This template is used to automatically generate and populate a template call for Template:Calendar for the month of March 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.