Difference between revisions of "Template:CalFillNovember"
From Nookipedia, the Animal Crossing wiki
PanchamBro (talk | contribs) |
HylianAngel (talk | contribs) m (Text replacement - "s]]' birthday" to "s]]'s birthday") |
||
Line 29: | Line 29: | ||
-->{{#ifeq: {{#var:firstDay}} | Tuesday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Tuesday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | ||
-->{{#ifeq: {{#var:firstDay}} | Thursday | {{center|'''[[Mayor's Day]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Thursday | {{center|'''[[Mayor's Day]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | ||
− | --><small><ul><li>[[Boris]]' birthday</li></ul></small> | + | --><small><ul><li>[[Boris]]'s birthday</li></ul></small> |
|<!--07-->{{#time:d|{{#expr:{{#var:firstDayNum}} + 6}} November {{#var:curYear}}}} = {{#ifeq: {{#var:firstDay}} | Sunday | {{center|'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small>}}}}<!-- | |<!--07-->{{#time:d|{{#expr:{{#var:firstDayNum}} + 6}} November {{#var:curYear}}}} = {{#ifeq: {{#var:firstDay}} | Sunday | {{center|'''[[Flea Market]]''' <small>({{WW|shortest|nolink}})</small>}}}}<!-- | ||
-->{{#ifeq: {{#var:firstDay}} | Monday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Monday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | ||
Line 83: | Line 83: | ||
-->{{#ifeq: {{#var:firstDay}} | Sunday | <div style="margin: 0 auto; text-align: center;">'''[[Bug-Off]]''' <small>({{NH|shortest|nolink}}) (''Southern Hemisphere only'')</small></div>}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Sunday | <div style="margin: 0 auto; text-align: center;">'''[[Bug-Off]]''' <small>({{NH|shortest|nolink}}) (''Southern Hemisphere only'')</small></div>}}<!-- | ||
-->{{#ifeq: {{#var:firstDay}} | Monday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}}/{{WW|shortest|nolink}})</small>}}}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Monday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}}/{{WW|shortest|nolink}})</small>}}}}<!-- | ||
− | --><small><ul><li>[[Flip]]'s birthday</li><li>[[Epona]]'s birthday</li><li>[[Phyllis]]' birthday</li></ul></small> | + | --><small><ul><li>[[Flip]]'s birthday</li><li>[[Epona]]'s birthday</li><li>[[Phyllis]]'s birthday</li></ul></small> |
|<!--22-->{{#expr:{{#var:firstDayNum}} + 21}} = {{#ifeq: {{#var:firstDay}} | Thursday | {{center|'''[[Turkey Day]]''' <small>({{PG|shortest|nolink}}, {{CF|shortest|nolink}}, {{NL|shortest|nolink}}, {{NH|shortest|nolink}})</small>}}}}<!-- | |<!--22-->{{#expr:{{#var:firstDayNum}} + 21}} = {{#ifeq: {{#var:firstDay}} | Thursday | {{center|'''[[Turkey Day]]''' <small>({{PG|shortest|nolink}}, {{CF|shortest|nolink}}, {{NL|shortest|nolink}}, {{NH|shortest|nolink}})</small>}}}}<!-- | ||
-->{{#ifeq: {{#var:firstDay}} | Sunday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Sunday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | ||
Line 125: | Line 125: | ||
-->{{#ifeq: {{#var:firstDay}} | Monday | {{center|'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small>}}}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Monday | {{center|'''[[Yay Day]]''' <small>({{WW|shortest|nolink}})</small>}}}}<!-- | ||
-->{{#ifeq: {{#var:firstDay}} | Saturday | {{center|'''[[Sale Day]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Saturday | {{center|'''[[Sale Day]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | ||
− | --><small><ul><li>[[Peaches]]' birthday</li></ul></small> | + | --><small><ul><li>[[Peaches]]'s birthday</li></ul></small> |
|<!--29-->{{#expr:{{#var:firstDayNum}} + 28}} = {{#ifeq: {{#var:firstDay}} | Sunday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | |<!--29-->{{#expr:{{#var:firstDayNum}} + 28}} = {{#ifeq: {{#var:firstDay}} | Sunday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | ||
--><small><ul><li>[[Kabuki]]'s birthday</li></ul></small> | --><small><ul><li>[[Kabuki]]'s birthday</li></ul></small> | ||
|<!--30-->{{#expr:{{#var:firstDayNum}} + 29}} = {{center|End of '''[[Mushrooming Season]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}}/{{NH|shortest|nolink}}) (''Northern Hemisphere only'')</small>}}<!-- | |<!--30-->{{#expr:{{#var:firstDayNum}} + 29}} = {{center|End of '''[[Mushrooming Season]]''' <small>({{CF|shortest|nolink}}/{{NL|shortest|nolink}}/{{NH|shortest|nolink}}) (''Northern Hemisphere only'')</small>}}<!-- | ||
-->{{#ifeq: {{#var:firstDay}} | Saturday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | -->{{#ifeq: {{#var:firstDay}} | Saturday | {{center|'''[[Fishing Tourney]]''' <small>({{PG|shortest|nolink}})</small>}}}}<!-- | ||
− | --><small><ul><li>[[Tasha]]'s birthday</li><li>[[Kicks]]' birthday</li></ul></small> | + | --><small><ul><li>[[Tasha]]'s birthday</li><li>[[Kicks]]'s birthday</li></ul></small> |
}}<noinclude><br> | }}<noinclude><br> | ||
{{Documentation}} | {{Documentation}} |
Latest revision as of 20:51, March 9, 2023
← October | November 2024 | December → | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
| ||||||||||||||
|
|
|
|
|
|
|
Template documentation (view)
Usage
{{CalFillNovember|year=YEAR}}
This template is used to automatically generate and populate a template call for Template:Calendar for the month of November for a year YEAR
. If no year is provided, the current year will be used.
Coding notes
- Two variables are predefined using Extension:Variables, namely
curYear
, which contains either the current year or a predefinedYEAR
, andfirstDay
, which is the first day of the current month for the yearcurYear
. - 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 the given month is a Tuesday, and if so it will insert information about the event (represented by{{#ifeq: {{#var:firstDay}} | Tuesday | ...}}
...
in this example). If an event lasts for more than one day (e.g. Bright Nights) a #switch function is used instead,
and the logic is essentially the same. The usage of{{#switch: {{#var:firstDay}} | Tuesday | Wednesday =...}}
#ifeq
is recommended to facilitate multiple overlapping events. - For days with multiple events (i.e., those with multiple
#switch
and#ifeq
functions), the following hierarchy is recommended.- Events that fall on a specific day every year (e.g., Valentine's Day and Leap Day), excluding birthdays
- Events that fall on a specific day on certain years (e.g., Festivale)
- Events that fall on a non-specific day but on a specific week (e.g., Fishing Tourney)
- Events that span multiple days (e.g., Bright Nights)
- Birthdays, non-special to special, alphabetical.
- The arrangement of multiple events that occur in the same hierarchy (e.g., January's Yay Day and Flea Market, which are both events that fall on a non-specific day but on a specific week) is up to the discretion of the editor; however, it is recommended that they be arranged in the following order: last appearance (events that have last appeared in later games are arranged first), regionally (all regions, NA, JP, EU, KO), alphabetically.
- Those who look at the code may be surprised when they see several
<!--\n\t-->
. The presence of this quirk is to make the code legible for future maintainers, and so that line breaks will not be recorded (e.g., if the#ifeq
statement fails). The reason why\n\t
is not used is because unwanted linebreaks will occur: see this comment for more information. For those who will revise the code in the future, they may temporarily replace<!--\n\t-->
with\n\t
using their regex-compatible text editor, and do the reverse afterwards. - With regards to overlapping events, it is assumed that multiple events will occur on the same day. For example, in April 1, 2018, both Bunny Day and April Fool's Day occur on the same day in New Leaf. Another example is February 14, 2026, when both the Fishing Tourney and Valentine's Day occur in City Folk. Unless otherwise stated, all events that overlap each other will occur at the same day.
- The calculation of certain holidays such as Festivale and Bunny Day are particularly difficult, for they depend on the lunisolar calendar. The implementation for these holidays is as follows: determine whether
{{#var:curYear}}
matches for some pre-determined date:
A list of all dates for Festivale must be known beforehand. This is much easier; however, it means that the template must be updated sometime in the future to show the correct dates for certain holidays.|28 = {{#switch: {{#var:curYear}} | 2022 | 2033 = ...