Template talk:Before
From Wikipedia, the free encyclopedia
The changeover from standard time to daylight time in the US took place on the second Sunday of March (3/11).
Daily tests:
Today is June 11, 2008, and tomorrow is June 12.
Mon 5/28: Memorial Day (US, observed) has come and gone.
Fri 6/01: The month of June 2007 has begun.
June 21: It is still spring in the northern hemisphere.
Sun 7/01: The month of July 2007 has yet to arrive.
Wed 7/04: Independence Day (US) is coming.
[edit] Revision History
I changed >= 0 to > 0 because I originally intended this template to return one of two phrases:
- before the date (e.g., April 13th is BEFORE April 14th)
- on or after the date (April 14th is not before April 14th)
I hope this didn't mess up any templates or pages depending on this. Anyway, better to fix it now before it gets widely used and entrenched. --Uncle Ed 14:07, 14 April 2006 (UTC)
- No problems. I updated it because I saw that this and some of the other templates were returning blank values after Tim changed some of the 'basic math' functions... partial conversion to the new functions wasn't translating down to all of the sub-templates correctly. However, I wasn't sure if it was meant to be >= or >. --CBDunkerson 14:13, 14 April 2006 (UTC)
[edit] Severe bug
What happened to the ability of this template to use template references as parameters?
- "{{before|3|11|time is {{utc|-5}} in ny|time is {{utc|-4}} in ny}}" → "time is 10:24 in ny"
- Example above should say "time is 10:24 in ny" (updated for 3/11/2007 change)
It worked fine last week, what happened? --Uncle Ed 19:14, 15 May 2006 (UTC) (modified --Ligulem 11:27, 16 May 2006 (UTC))
- This looks like a manifestation of the 'numbered parameters' bug (mediazilla:5678) of m:ParserFunctions. If you assign the fourth parameter specifically as '4=' it works correctly;
- {{before|3|26|time is {{utc|-5}} in ny|4=time is {{utc|-4}} in ny}} = time is 10:24 in ny
- I'm not sure why it just stopped working recently. The problem is that it is treating the fourth parameter not as the value you specified in the call, time is {{utc|-4}} in ny, but as the fourth value in the #ifexpr:, {{{4}}}. Using named parameters (e.g. 'then' and 'else') would avoid the problem or the specific numbers can be put in as above. --CBDunkerson 20:37, 15 May 2006 (UTC)
-
- I believe a workaround for this is simply to replace all things like {{{4}}} with {{{4|}}} (this was proposed on the talk of M:PF). I have done that on {{harvard citation}}, which works like a charm since I did that. Previously I had done it with an extra template call layer on {{harvard citation}}, which converts to named params, but that is no longer needed when adding the "|" on every use of a numbered param. --Ligulem 21:15, 15 May 2006 (UTC)
- That was the first thing I tried. Just seemed to suppress any display... which might be sufficient for some of the other templates encountering this problem. Doesn't work for this one though. --CBDunkerson 21:42, 15 May 2006 (UTC)
- You should not look at the uncalled template page. I believe it should work. Could you give an example for a call that produces a wrong result using this version? --Ligulem 21:50, 15 May 2006 (UTC)
- Yeah. See above under "Severe bug". There is an opening sentence followed by "Example above should say time is 10:24 in ny". In between those (the "example above") is a call to this template which is producing no result at all. Prior to adding the |s it showed {{{4}}}. --CBDunkerson 10:31, 16 May 2006 (UTC)
- Dumb me. Apologies. --Ligulem 11:04, 16 May 2006 (UTC)
- Yeah. See above under "Severe bug". There is an opening sentence followed by "Example above should say time is 10:24 in ny". In between those (the "example above") is a call to this template which is producing no result at all. Prior to adding the |s it showed {{{4}}}. --CBDunkerson 10:31, 16 May 2006 (UTC)
- You should not look at the uncalled template page. I believe it should work. Could you give an example for a call that produces a wrong result using this version? --Ligulem 21:50, 15 May 2006 (UTC)
- That was the first thing I tried. Just seemed to suppress any display... which might be sufficient for some of the other templates encountering this problem. Doesn't work for this one though. --CBDunkerson 21:42, 15 May 2006 (UTC)
- I believe a workaround for this is simply to replace all things like {{{4}}} with {{{4|}}} (this was proposed on the talk of M:PF). I have done that on {{harvard citation}}, which works like a charm since I did that. Previously I had done it with an extra template call layer on {{harvard citation}}, which converts to named params, but that is no longer needed when adding the "|" on every use of a numbered param. --Ligulem 21:15, 15 May 2006 (UTC)
My edit [1] seems to have fixed the bug.--Patrick 12:14, 16 May 2006 (UTC)