Jump to content

Template talk:Day

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

2k8 leap year bug

[edit]

{{RFCsci | section=RfC: Can someone fix this bug please !! reason=Uncontroversial but urgent assistance needed to fix errors in over 300 articles due to bug in template!! time=22:22, 1 January 2008 (UTC)}}

Although there is no dispute or controversy here, I am using the RfC mechanism to draw wider attention urgently to a bug in this template, because it puts errors into over 300 articles! Please see below.

This template is currently getting the calculation wrong for March 1 - December 31. Using this template as it currently stands:

February 28 says:
February 28 is the 59th day of the year in the Gregorian calendar. There are 306 days remaining until the end of the year (307 in leap years).
Correct.
February 29 says:
February 29 is a day added into a leap year, a 60th day of the Gregorian calendar. There are 306 days remaining till the end of the year.
Correct.
March 1 says:
March 1 is the 61st day of the year (62nd in leap years) in the Gregorian calendar. There are 304 days remaining until the end of the year.
WRONG. It is the 60th (61st in leap years); there are 305 days remaining.
This error then carries through, right through to December 31, which says:
December 31 is the 366th day of the year (367th in leap years) in the Gregorian calendar. There are -1 days remaining until the end of the year.
which is patently absurd.

I don't think I'm going to try to debug it myself, but can I suggest that someone more familiar with template syntax would please do so. Thanks. — Alan 21:59, 1 January 2008 (UTC)[reply]

I checked what it will say on February 30 and it said:

February 30 is the 61st day of the year (62nd in leap years) in the Gregorian calendar. There are 304 days remaining until the end of the year.

That doesn't help right. Anyone know what does?? Perhaps the fact that we're now in a leap year might be what results in this. If nothing happens to change the template, it will revert to proper in 2009, but then have this error again in 2012. Georgia guy (talk) 22:03, 1 January 2008 (UTC)[reply]

Perhaps the fact that we're now in a leap year might be what results in this.
Very astute observation -- I suspect you are almost certainly right.
The Google cache for the March 1 page, from some time last week, says:
March 1 is the 60th day of the year (61st in leap years) in the Gregorian calendar. There are 305 days remaining until the end of the year.
which is correct. The template itself hasn't been changed for a few months, so for the page content to have changed so recently, it does appear that the text that it produces must somehow depend on the current date (which it clearly shouldn't).
— Alan 22:12, 1 January 2008 (UTC)[reply]

The template was using {{#time:z}} to get which day in the year the date is, but this parserfunctions takes leap years into account, something that is undesirable for these pages. I reworked the calculation and the issues should now be fixed. --TheDJ (talkcontribs) 16:45, 2 January 2008 (UTC)[reply]

Thanks. — Alan 14:54, 9 January 2008 (UTC)[reply]

linked-title

[edit]

Why {{linked-title}} won't work here... The reason is simple, it uses the "RealTitle" javascript hack, and unfortunately, that only works on titles that "normalize" to the same name as the articlename. And "January 1" and "1 January", do not normalize to the same of course. With RealTitle, you can basically only change formatting of some letters, you cannot change the order of the letters (the reason is that people would "misuse" such a trick). As such trying to use this for {{day}} to account for date localization is pointless. --TheDJ (talkcontribs) 14:37, 6 July 2008 (UTC)[reply]

Inclusion criteria

[edit]

Most day-of-year articles have the same inclusion criteria. If we can figure out what they are, they should be in this template. — Arthur Rubin (talk) 09:42, 3 October 2014 (UTC)[reply]

Present tense

[edit]

The phrase unqualified phrase, "there are N days remaining in the year," is awkward and inaccurate. Better would be, "after this day, N days remain in the year," or at least, "on this day, there are N days remaining in the year." Do people agree? If so I ask that a privileged Wikipedian make the change. 128.193.154.132 (talk) 20:42, 7 November 2018 (UTC)[reply]

I'd argue the phrase should be "𝑥 days remain in the year". It is implied that the count includes today. —Hugh (talk) 00:51, 12 March 2019 (UTC)[reply]

 Not done: According to the page's protection level you should be able to edit the page yourself. If you seem to be unable to, please reopen the request with further details. Alucard 16❯❯❯ chat? 12:18, 21 March 2019 (UTC)[reply]
The template needs to be changed because when you start a sentence with a number, you are supposed to spell it out. Saying "213 days are left in the year.", for example, is extremely lazy. I would change it but I am not sure how to do it. posty (talk) 18:20, 12 May 2019 (UTC)[reply]

December 31

[edit]

Could someone please change this template so that the lead for December 31 reads "December 31 is the 365th day of the year (366th in leap years) in the Gregorian calendar." rather than the current "December 31 is the 365th day of the year (366th in leap years) in the Gregorian calendar;" (i.e. please change the final character from ";" to ".")? Thanks, Kiwipete (talk) 04:41, 10 April 2022 (UTC)[reply]