Template talk:Archive header
From Wikipedia, the free encyclopedia
Contents |
[edit] Usage
<noinclude> {{subst:Archive header |dateNumeral = |monthFull = |deskType = }} </noinclude>
[edit] Bug
FYI If this template copied the exact date math from Template:Reference desk navigation it's going to be subject to the same currentyear glitch as the older template--172.166.213.97 21:09, 10 October 2006 (UTC)
[edit] Transclusion
The header will now point to the current desk when it determines that there is no existing archive page newer than itself. This is because when editing live transclusion pages, you could only move foward to 2 days before the current date. Now you can move forward to the current date. freshofftheufoΓΛĿЌ 01:32, 27 October 2006 (UTC)
[edit] Bug fix
I'm going to change the code of the NextMonth template to this:
{{#ifeq:{{CURRENTMONTH}}|1|{{#time:F|{{{2|August}}}+1 month}} {{CURRENTYEAR}}|{{#time:F Y|{{{2|August}}} {{{1|20}}}+1 month}}}}
and after that I'll do the same to the tomorrow templates as a fix to the problem when the year changes.
I'm pretty sure the code is sound, but I have a reputation for making silly coding mistakes so can someone just confirm that it's OK? The pseudo code would look like this:
if CURRENTMONTH is 1 print calculateDate(month) + " " + CURRENTYEAR else print calculateDate(month and year) end if
This way, if the bot calculates NextMonth for January in December (it shouldn't), the #time function will automatically roll over to the next year (normal), and if it calculates NextMonth for January in January (it passes "December" as a parameter, so this is possible, and the bot should be doing this at 0:00), the year will default to CURRENTYEAR and won't roll over (added). I'm tired, I should only be attempting this with a clear head. freshofftheufoΓΛĿЌ 08:57, 28 October 2006 (UTC)
[edit] New Bug Fix
Sorry I kind of disappeared there without finishing off the fix before the new year. I still don't plan on being active for a while, but I just wanted to say thanks to VP and Martin and all for fixing up that mess that I really should have averted long ago. Later dudes. freshofftheufoΓΛĿЌ 04:23, 15 January 2007 (UTC)