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 = < | + | |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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = <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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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 = {{#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>[[Biff]]'s birthday</li></ul></small> |
− | + | |30 = <small><ul><li>[[Felicity]]'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 | ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
|
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:
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,{{#ifeq: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Tuesday |...
however the logic is essentially the same.{{#switch: {{#time:l|01 February {{{year|{{LOCALYEAR}}}}}}} | Tuesday | Wednesday =...
- 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:
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.|27 = {{#ifeq: {{{year|{{LOCALYEAR}}}}} | 2017 |...