Template talk:Birth date and age/Archive 4

Months and days
Can an editor please modify the code for said templates so that, for ages below two years, ages are shown in months and days rather than in years. Pinging users who commented in support of showing months and days from the discussion above --Nev&eacute;–selbert 00:58, 13 December 2017 (UTC)
 * I supported months, not months and days. When someone asks how old your baby is, you might say s/he's 14 months, or you might say s/he's almost 15 months, but you very rarely say s/he's 14 months and 22 days. You probably don't know the answer to that much precision; if you do, you probably are aware that the asker isn't interested in that much precision. If the above discussion closed as months and days, and there has been no serious objection to that close, fine. I always respect consensus. Just don't ping me and say I supported that. &#8213; Mandruss  &#9742;  01:11, 13 December 2017 (UTC)
 * Agreed with Mandruss; we also have a math problem: Except in rare cases we do not know the birth time, so a down-to-the-day calculation will be wrong (WP:OR) for at least part of the day (quite possible most of the day, depending on birth time). Technically such an error can be true for part of a month, but only a very small part (1/28th to 1/31st). But people do not expect absolute precision when we're talking in months; they expect way more precision when we're talking in days.  — SMcCandlish ☏ ¢ &gt;ʌⱷ҅ᴥⱷʌ&lt;  05:29, 13 December 2017 (UTC)
 * Red information icon with gradient background.svg Not done: please make your requested changes to the template's sandbox first; see WP:TESTCASES. —&thinsp;JJMC89&thinsp; (T·C) 04:10, 13 December 2017 (UTC)

I agree that no changes to the main template should occur until thoroughly tested and agreed. However, I added some quick code to Module:Age/sandbox to implement this template for consideration. Use birth date and age/sandbox to test. The module requires valid dates and accepts input in a variety of formats. There are likely to be many templates in articles with invalid dates and switching to the module would require a fair bit of maintenance. Some examples: I checked Template:Birth date and age/testcases from before using the module with the result after switching. There was no visible difference except for the "Bogus dates" section where the module displays error messages. Johnuniq (talk) 09:46, 13 December 2017 (UTC) — SMcCandlish ☏ ¢ &gt;ʌⱷ҅ᴥⱷʌ&lt;  02:09, 17 December 2017 (UTC) But I confess to some confusion here. Why are we continuing this discussion as if the above close didn't happen, not to mention influencing participation to a significant degree by selective pinging? If you hope to do an end run around accepted process, I'm the wrong guy to ping. If you feel the above consensus was an unacceptable one resulting from inadequate participation (I would probably agree), start an RfC. &#8213; Mandruss  &#9742;  03:56, 17 December 2017 (UTC)
 * Any thoughts about the above examples? The logic currently used in the module is to show months + days if age < 1 year, or years + months if age < 3 years, otherwise years. Perhaps some royalty or similar cases warrant months + days? I agree with SMcCandlish and others that days are a problem but there may be examples where it is useful. I am planning to propose changing the template to use the module mainly so invalid dates can be tracked, but I would like to settle on what is wanted for infant ages. Johnuniq (talk) 01:24, 17 December 2017 (UTC)
 * Seems reasonable to me so far. The "There are likely to be many templates in articles with invalid dates and switching to the module would require a fair bit of maintenance" part is the real question, I guess.  Is there anything that works now that would break afterward?  Maybe do the testcases page in before/after format like usual, and throw more data at it, like , and  , and  , and  , and   and  , and other things that are "errors" or actual errors, and see how consistent the live and sandbox results are.  I'm thinking of the amount of hair-pulling going on over at Template talk:Lang about recent upgrades (really badass ones) to the module but which are causing a lot of temporary breakage. So much venting, so much venting .... As for infants, I oppose doing days for reasons already given, and because it's an unnecessary complication, and per WP:NOT, and per the diffuse site-wide consensus that infoboxes are already over-complicated and over-inclusive of trivia (even if we're not entirely sure what do about that or to what extent to do something about it, or exactly which things are too trivial – baby age down to the day almost certainly qualifies).
 * I can see "days only" up to 31 days. That seems better than the alternatives: 0 months, <1 month, or no age at all. I've yet to see any good rationale for days above 31, so I stand by my previous comments with the preceding amendment.
 * Sorry, I'm just a coder with no opinion on the RfC because I don't recall any cases of infants. I dumbly copied the ping from above, while adding the OP. I'm hoping that someone will announce a decision so I can code it. The close included "for infants under 2 years, age should automatically be displayed in months and days" but this section qualified that, and I agree there is no reason to say someone is aged 14 months and a number of days.
 * Re broken dates, see below—there are only a small number according to the wikitext in articles at 3 November 2017. That does not count any broken instances of templates there may be that call this template.
 * I just extracted all occurrences that use 2017 (search for "(age 0)" to see them):
 * Louis Cheung  → March 23, 2017
 * The Return of Superman (TV series)  → November 8, 2017
 * Adrian Budka  → September 7, 2017
 * Radford family  → September 18, 2017
 * They are inconsequential, no royals that I can see. I might look at 2016 later. Johnuniq (talk) 04:39, 17 December 2017 (UTC)
 * I think these are all occurrences of 2016 dates using this template. Search for "(age 1)" to see the text.
 * Bringing Up Bates  → June 20, 2016   → June 20, 2016
 * Descendants of King George V and Mary of Teck  → January 16, 2016   → January 16, 2016
 * House of Bourbon-Parma  → April 24, 2016   → April 24, 2016
 * List of members of the House of Windsor  → January 16, 2016
 * Radford family  → July 24, 2016
 * State of Matter MAAP Racing (bogus date)  → January 1, 2016
 * The Return of Superman (TV series)  → July 12, 2016   → July 12, 2016
 * Johnuniq (talk) 07:01, 17 December 2017 (UTC)
 * And 2015; search for "(age 2)" to see the text.
 * 19 Kids and Counting  → April 6, 2015   → July 16, 2015   → November 5, 2015
 * Aamna Sharif  → September 14, 2015
 * Angela Tong  → September 23, 2015
 * Bei Bei  → August 22, 2015
 * Billy Constable  → August 22, 2015
 * Bringing Up Bates  → April 11, 2015   → May 14, 2015
 * Descendants of King George V and Mary of Teck  → May 2, 2015
 * Duck Dynasty  → November 6, 2015
 * House of Bourbon-Parma  → December 16, 2015
 * Jia Yueyue and Jia Panpan  → October 13, 2015
 * Jill Duggar Dillard  → April 6, 2015
 * List of giant pandas  → August 22, 2015   → October 13, 2015
 * List of members of the House of Windsor  → May 2, 2015
 * Maya S. Krishnan  → October 25, 2015
 * Prince Nicolas, Duke of Ångermanland  → June 15, 2015
 * Princess Charlotte of Cambridge  → May 2, 2015
 * Radford family  → June 3, 2015   → June 3, 2015
 * The Return of Superman (TV series)  → April 12, 2015   → June 10, 2015   → October 11, 2015   → December 4, 2015   → December 29, 2015   → December 30, 2015
 * Johnuniq (talk) 09:19, 17 December 2017 (UTC)

Infants proposal
I updated Module:Age/sandbox to try a new procedure to display ages of infants: That is, if someone has just been born, their age would be displayed as 0 days. A day later it would (if purged!) be 1 day, then 2 days, up to the number of days in the month. Then it would switch to showing 1 month. A month later, it would show 2 months, and so on, up to 23 months. After that it would show 2 years, then 3 years, and so on.
 * Show age in days if months < 1, or show months if years < 2, otherwise show years.

Examining the examples from articles in the preceding section shows this would give a reasonable result, and one that would be more satisfactory than the current situation. Examples:

After more checking and thinking I will propose implementing this. Johnuniq (talk) 10:10, 23 December 2017 (UTC)

Template changed to use module
Per my proposals above, I have changed the template to use Module:Age. Differences that may be noticed are:
 * As outlined at above, an age is displayed as 0 days to 31 days (if under 1 month), then as 1 month to 23 months (if under 2 years), then as 2 years or older.
 * If a date is invalid a big red error message is displayed and the article is placed in Category:Age error.

A birth date may be entered as year/month/day (like the old template), or may be entered as a single date. Examples:
 * → December 5, 2001
 * → December 5, 2001
 * → 2001
 * → 5 Dec 2001
 * → December 5, 2001

As mentioned, the module rejects invalid dates. It also has code to detect invalid parameters but that has not yet been enabled as it is unclear how many problems would be found. Adding  to the wikitext at Template:Birth date and age would add the tracking category and display a warning for unknown parameters. For compatibility with the old template, any non-empty text is equivalent to "yes" for. For example,  and   give the same result (day-first format). Johnuniq (talk) 00:38, 31 March 2018 (UTC)

Invalid dates
Following above, I investigated what invalid birth dates exist in articles to see whether switching the template to use Module:Age would be a major problem. It appears not, as only the following have dates which would be regarded as invalid by the module. There are a handful of really broken templates where junk has found its way into the wikitext, but I haven't included them here. For brevity, the following use bda which is a redirect to Birth date and age.
 * I changed the wikitext in the third column in the following tables to show the output displayed by old template. Johnuniq (talk) 00:50, 31 March 2018 (UTC)

Each of the following has a problem which would cause the module to show "Error: Need valid year, month, day". Parameter  is accepted for the year, so the module rejects "yes" as an invalid year.
 * The above have been fixed. Johnuniq (talk) 03:41, 23 December 2017 (UTC)

Each of the following has an invalid date which would cause the module to show "Error: Need valid year, month, day". I am thinking that the template should be switched to use the module. Johnuniq (talk) 10:06, 16 December 2017 (UTC)
 * I fixed the errors in the above articles, but am still planning use of the module. Johnuniq (talk) 03:41, 23 December 2017 (UTC)

An editor has raised a concern about the way this template renders
and seem to think that the birth date and age template's use of (age 26) instead of (age 26 years) is both problematic and incorrect. The editor has taken correcting that problem in articles. I warned the editor that this behaviour was unconstructive and suggested that a discussion should be started at the template, which is why I have started this discussion. Walter Görlitz (talk) 06:05, 1 May 2018 (UTC)
 * I commented here and here. Johnuniq (talk) 07:17, 1 May 2018 (UTC)

Birthday - Incorrect age extrapolated from birth date
Age calculation appears to be wrong for a person's birthday. Age does not rollover till day after person's birthday. — Preceding unsigned comment added by 217.42.221.55 (talk) 07:21, 24 June 2018 (UTC)
 * On which article do you see this problem? -- Red rose64 &#x1f339; (talk) 20:09, 24 June 2018 (UTC)
 * Pages at Wikipedia are held in a cache: the last generated page is shown to people reading the page to avoid the overhead of needing to convert the wikitext to HTML on every view. That means ages are probably wrong by a day or so. One easy fix for a particular article is to edit the whole page then save it (publish) without making any change and with no edit summary. Johnuniq (talk) 23:21, 24 June 2018 (UTC)
 * , Thanks for this. This info should perhaps be mentioned with some degree of emphasis on the template page. Wwwhatsup (talk) 18:56, 13 May 2019 (UTC)
 * Good idea, I put a box in the documentation with the information. It's a shame there are so many notices. Johnuniq (talk) 02:33, 14 May 2019 (UTC)
 * An edit shouldn't be necessary, a WP:PURGE should be quite sufficient. -- Red rose64 &#x1f339; (talk) 11:50, 5 June 2019 (UTC)

Error
Why is 6/1/1968 showing an age of 50 on 6/3/2019? Shouldn't it be 51? See Larry Centers. It correctly shows 51 on this page but not on the Larry Centers page (cut and paste Born:	June 1, 1968 (age 50)). June 1, 1968 Subst ( 1968-06-01 ) June 1, 1968 (age 51) and realtime June 1, 1968. — Preceding unsigned comment added by 2600:8800:1300:A2E:0:0:0:1002 (talk) 17:34, 4 June 2019 (UTC)
 * It is showing June 1, 1968 (age 51) Walter Görlitz (talk) 17:39, 4 June 2019 (UTC)
 * I saw it was showing 50, but I edited the infobox, added a space before the template, and it fixed it, made it 51. Must be a cache thing.  (see the topic immediately preceding this one) --rogerd (talk) 18:02, 4 June 2019 (UTC)

I encountered a similar error. The space edit trick worked.  Eve rgr een Fir  (talk) 03:42, 19 August 2019 (UTC)
 * There is no need to insert a space. See section immediately prior to this: edit whole page, click Publish, no edit summary. That does not record an edit but it updates the cache. Johnuniq (talk) 04:08, 19 August 2019 (UTC)
 * You don't even need to edit; as I advised above, a WP:PURGE is sufficient. -- Red rose64 &#x1f339; (talk) 08:19, 19 August 2019 (UTC)
 * Thanks but of course you and I know that, whereas the "edit and publish" advice is very easy to remember and very easy to do for people who might not recall ?action=purge. Johnuniq (talk) 10:29, 19 August 2019 (UTC)
 * I don't even do that. There are two gadgets available:
 * At, enable either one, but not both. -- Red rose64 &#x1f339; (talk) 19:55, 19 August 2019 (UTC)
 * At, enable either one, but not both. -- Red rose64 &#x1f339; (talk) 19:55, 19 August 2019 (UTC)
 * At, enable either one, but not both. -- Red rose64 &#x1f339; (talk) 19:55, 19 August 2019 (UTC)

Template-protected edit request on 14 October 2019
Mary Almond (https://en.wikipedia.org/wiki/Mary_Almond) died 26th April 2015, age 87 in Gloucestershire Royal Hospital 2A00:23C6:3103:3601:F88C:DCCB:31BE:ECE0 (talk) 16:00, 14 October 2019 (UTC)
 * Red information icon with gradient background.svg Not done: please provide reliable sources that support the change you want to be made. Izno (talk) 16:11, 14 October 2019 (UTC)
 * This would have been more suited to -- Red rose64 &#x1f339; (talk) 22:41, 14 October 2019 (UTC)
 * I considered answering the real question to be of higher interest. --Izno (talk) 00:11, 15 October 2019 (UTC)

Template-protected edit request on 25 October 2019
Una667770 (talk) 11:46, 25 October 2019 (UTC)
 * answered=Yes 24 October 1973

Una667770 (talk) 11:48, 25 October 2019 (UTC) Birth year 1973


 * Red information icon with gradient background.svg Not done: this is the talk page for discussing improvements to the template . Please make your request at the talk page for the article concerned. It's at Talk:Jamie Chua where you'll need to provide a reliable, verifiable, independent source for your data. Cabayi (talk) 11:54, 25 October 2019 (UTC)

Template-protected edit request on 26 May 2020
Date of Birth 19.09.1965 2A02:8084:2562:DD80:C495:4844:F395:B36F (talk) 21:14, 26 May 2020 (UTC)
 * Red information icon with gradient background.svg Not done: this is the talk page for discussing improvements to the template . Please make your request at the talk page for the article concerned. – Jonesey95 (talk) 21:25, 26 May 2020 (UTC)

df=no
-> October 3, 1991

In this example,  is misleading, as the code behind the parameter only checks for a non-blank value -    has the same effect as. I just fixed this at Vanessa Vanjie Mateo. Is there an easy way to tell if this error is common? Is it worth adding a tracking category? -- John of Reading (talk) 09:12, 25 January 2021 (UTC)
 * I can't search at the moment but someone at WP:VPT might know the name of the tool (template tiger?) that provides information on what parameters are in use for a specified template. Re the problem, I would far prefer to require the parameter to be valid (anything not documented giving an error) but I decided to just emulate the old template in Module:Age. That was easier and less hassle because I also did not know how many broken parameters there were, so introducing a new error might have led to a large number of cases to be investigated when in fact people had been happy with what the template showed for a considerable period. In short, I'm not sure what to do. There are many template parameters that work like this. Johnuniq (talk) 10:09, 25 January 2021 (UTC)

Problem fixing age error
The article explains why the age of a living person may be shown incorrectly, and advises dealing with this by making a 'non-edit', not changing anything. I tried this on the page Henry Stapp which hadn't updated on his birthday. Curiously this worked at the time but the next morning it had reverted to the erroneous age, I suspect as the result of the activity of a bot that had spotted my non-change and wanted to set the record straight. I've tried again now, this time adding a character with one edit and then removing it with the next. Hopefully this will work properly now. But assuming what I've just said is correct, it means that the advice in this article needs updating. --Brian Josephson (talk) 08:45, 25 March 2021 (UTC)
 * There must be some other explanation. You don't need to change anything in the article to fix an incorrect age: just click edit then publish with no change and no edit summary. The last edit before yours was by Monkbot on 23 December 2020‎ so that had no effect on the age issue. Your browser or even your ISP can cache (hold a copy) of a webpage so it doesn't have to fetch it again. Perhaps you saw the old page (from before the age was fixed) as a cached copy. Johnuniq (talk) 09:19, 25 March 2021 (UTC)
 * Perhaps, but do you know if there's recently been a software update that might have led to the problem? Because as I pointed out on the Henry Stapp talk page, Wikipedia seemed to be acting rather oddly at that time. --Brian Josephson (talk) 11:55, 25 March 2021 (UTC)
 * Again, not likely. But further to Johnuniq's post, an edit (even one that changes nothing) is more than enough; a WP:PURGE is all that is necessary. -- Red rose64 &#x1f339; (talk) 17:10, 25 March 2021 (UTC)
 * Agree. The null edit was a way to clear the cache in the past, but it should no longer be an issue. What exactly is the error on the subject's age with respect to his birth date? Walter Görlitz (talk) 17:23, 25 March 2021 (UTC)
 * It said his age was 92 when it should have been 93 (since his recent birthday). I'm still puzzled as to the way w'pedia was behaving yesterday on Firefox.  I believe it recovered without my doing a restart or whatever.  Did no one else notice anything? --Brian Josephson (talk) 17:53, 25 March 2021 (UTC)
 * Here's how it works. accepts input that describes a person's birth date, and subtracts that date from the current date to give their age in years, and this age gets displayed after the birth date. So far, so good. But, the age calculation is only performed when the page is re-parsed: ordinarily, this happens when somebody edits the page and saves their edit - if somebody who is not logged in merely views the page, and it was last edited on the previous day (or earlier), the person viewing the page gets shown the version as it was at the last save. The MediaWiki software provides a means for the calculation to be re-executed without editing the page, this is WP:PURGE as I mentioned above. Anybody who is not logged in who views the page after a purge will then get shown the version as it was at the time of that purge. People who are logged in who view the page will be shown the correctly-calculated age, but that action does not cause a purge - logged out users who view the page after that will still be shown the version as at the last edit (or purge). -- Red rose64 &#x1f339; (talk) 21:28, 25 March 2021 (UTC)
 * Yes, yes, I understand. It's a pity I didn't do a screengrab at the time the edit page was looking very odd yesterday, but I guess unless we can do time travel that's not going to be possible.  Let's leave it now, anyway. --Brian Josephson (talk) 21:33, 25 March 2021 (UTC)

Template-protected edit request on 29 March 2021
You and I both know, he isn’t 69, but he’s infact 79, given birth to 1949 March 29, let’s make Nigeria better, this man would probably come into power again and ruin our lives, to what end will this stupidity stop? XAit12 (talk) 14:20, 29 March 2021 (UTC)

Make Nigeria better XAit12 (talk) 14:20, 29 March 2021 (UTC)


 * Request is not relevant to this page, thanks. MilborneOne (talk) 14:24, 29 March 2021 (UTC)

Range of years should be added functionality
This template should be able to accept a range of years for circa. -- The SandDoctor Talk 01:46, 17 April 2021 (UTC)
 * No, this template is only for use when you know the birth date precisely. If you don't, other templates are available, such as . -- Red rose64 &#x1f339; (talk) 10:18, 17 April 2021 (UTC)

Can we implement auto-detection of date format?
Use dmy dates and Use mdy dates are becoming more common. I imagine it would be feasible to have this template use that information to set the date format, as Citation templates already do. Would this be a good idea? – Anon423 (talk) 19:06, 9 February 2022 (UTC)
 * Obviously there should be a way for an article to be flagged as following dmy or mdy date formats so age and citation templates can do the right thing. However, that requires a central design which might be pondered at WP:VPT (to see if anyone has generic ideas) and WT:Lua (to discuss a module). IMHO it's ridiculous for different modules to read and parse the entire wikitext of an article to guess about something like a date format. I think there is a second module which reads the whole page, and I'm not going to write a third. There could be a specific module that does nothing other than read/parse a page then return a table of configuration data including, for example, date = dmy. Then citation modules would use mw.loadData to get that table, and so would age modules. That would mean the article would be read and parsed once with the same logic used by any module that needs the config info. Johnuniq (talk) 01:24, 10 February 2022 (UTC)
 * Since references already do so, I assume it is possible. Walter Görlitz (talk) 05:35, 22 February 2022 (UTC)
 * Yes, it is possible to make a reasonable guess but it requires reading and parsing the entire wikitext of an article. That is a large overhead and maintenance burden that should be done in only one module dedicated to that purpose, not implemented in several different modules that might find it handy. Johnuniq (talk) 06:38, 22 February 2022 (UTC)
 * There is a guideline that states that the article and references can have different date formats, and so it would not be advisable to force it. Walter Görlitz (talk) 20:58, 28 February 2022 (UTC)