Template:CalFillMarch

From Nookipedia, the Animal Crossing wiki
Revision as of 10:12, April 4, 2019 by Decomposer (talk | contribs) (Added info on Bunny Day from reference: http://tlarsen2.tripod.com/thomaslarsen/easterdates.html)


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

Usage

{{CalFillMarch|year=YEAR}}

This template is used to automatically generate and populate a template call for Template:Calendar for the month of March for a year YEAR. 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 {{#var:curYear}}}} | 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 {{#var:curYear}}}} | Tuesday | Wednesday =...

    however the logic is essentially the same. The usage of #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. The arrangement of multiple events that occur in the same category (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, as much as possible, they should be arranged from earliest appearance (game) to latest, regionally (international, NA, JP, EU, KO), alphabetically.
      • 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.
    • Those who look at the code may be surprised when they see <!--\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 page for more information. For those who will revise the code in the future, they may temporarily replace <!--\n\t--> with \n\t in a 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 1 April 2018, both Bunny Day and April Fool's Day occur on the same day in New Leaf. Another example is 14 February 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:

    |28 = {{#switch: {{#var:curYear}} | 2022 | 2033 = ...

    A list, for example, 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 in 2050 onward and for future releases.