Template talk:Calendar

From Nookipedia, the Animal Crossing wiki
Revision as of 12:46, January 23, 2022 by Sunmarsh (talk | contribs) (+unsigned template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Broken if not current month?[edit]

So first of all, this is like the most insane template I've ever seen. The amount of wiki logic that goes into it is just crazy, and I'm not even going to pretend like I understand all of it. It's really impressive! However, I can't seem to get it working when I want to generate a calendar for a different month. The shaded/unshaded cells seem to be off, perhaps hardcoded for only August 2015.

← August September 2024 October →
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5

Any ideas why this could be happening, sunmarsh? --Jake 18:31, August 16, 2015 (EDT)

Thanks! ^^; The basic template isn't too complicated, it's when I started to add the shading for previous months and the custom text that things got crazy. From the way it's displaying I can see there are several places in the template that need to be adjusted. I'll see what I can do... Sunmarshsignature.png (talk) 18:57, August 16, 2015 (EDT)
Don't have time to fix all of this now, but I figured out what the problems are and am basically jotting them down here for later.
  1. Nested #ifeq statements should assign previous month dates in descending order.
  2. Template needs to check whether cell should be shaded light before shading dark.
  3. Wiki logic seems to generate day names for dates a month doesn't necessarily have. (e.g. if September had 31 days in 2015 it would fall on a Thursday). I need to have the template check the amount of days in the current month before entering a date for the possible last day of the month (dates 28-31). Sunmarshsignature.png (talk) 19:26, August 16, 2015 (EDT)
Just wanted to say: this has got to be one of the coolest and most impressive templates I've seen. You never cease to amaze. ~SuperHamster Talk 21:41, August 16, 2015 (EDT)
Jeezus, SuperHamster and Jake, you guys are right. :D Mario Signature.png 22:34, August 16, 2015 (EDT)
It's so complicated that it actually broke the diff. I've never seen that happen before. --Jake 22:47, August 16, 2015 (EDT)
Just a little update on these issues: I've corrected all of the problems with the wrong dates being displayed, however there are still issues with shading in months that have less than 31 days. I also realized while I was fixing these issues that the template will generate an extra week for February if the month begins on Sunday and it is not a leap year. I've generated the code to fix this, but will wait until I've fixed other issues first before applying it, as it requires I reformat some existing code. Hopefully I'll have everything finished tomorrow. Sunmarshsignature.png (talk) 22:53, August 18, 2015 (EDT)
Everything should work now. I've done a little bit of testing and it's displaying correctly for all of the months in this year. If you spot any other errors let me know. Sunmarshsignature.png (talk) 12:10, August 19, 2015 (EDT)

Color issue with previous/next month dates[edit]

This is a note to myself, but also worth posting so all are aware:

This template makes use of four shades of colors, the ColorPrimary and ColorSecondary colors as well as two other shades that were variants of ColorPrimary and ColorSecondary at the time of this template's creation. As the site's seasonal theme has changed, so have ColorPrimary and ColorSecondary. For this reason, the colors that are hard-coded into the template are not playing nicely with the updated ColorPrimary and ColorSecondary colors. I'll be changing this template to use only ColorPrimary and ColorSecondary (and black and white) within the next few weeks so that the calendar colors will continue to display properly in the future. (Also there's something up with the February 2019 calendar... gotta look into that.) - unsigned comment from Sunmarsh (talkcontribs)