Template talk:Age
This is the talk page for discussing improvements to the Age template. |
|
Archives: 1 |
This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
|
Template:Age is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
This template was nominated for deletion. Please review the prior discussions if you are considering re-nomination:
|
Supporting dates without separating y/m/d into separate fields?
editIt would be useful if it were possible to call this template as, e.g., {{age|11 March 1952|11 May 2001}} (for Douglas Adams). Would that be feasible to do? That way, we could make use of it in Wikidata infoboxes more easily (e.g., at its simplest, {{Age|{{#property:P569}}|{{#property:P570}}}}), rather than the more messy way currently used in {{Infobox person/wikidata}}. Also @RexxS, Laurdecl, Johnuniq, and Thayts: in case any of them can help. :-) Thanks. Mike Peel (talk) 20:22, 18 November 2017 (UTC)
- Module:Age can handle that, although it's so long ago that I forget if there were any quirks with this particular template. At any rate, I just put it in {{age/sandbox}}:
{{age|1952|3|11|2001|5|11}}
→ 49{{age/sandbox|1952|3|11|2001|5|11}}
→ 49{{age/sandbox|11 March 1952|11 May 2001}}
→ 49{{age/sandbox|11 MAR 1952|11 May 2001}}
→ 49{{age/sandbox|March 11, 1952|2001-5-11}}
→ 49
- Johnuniq (talk) 22:12, 18 November 2017 (UTC)
- @Johnuniq: Ooh, that works nicely, thank you! Mike Peel (talk) 22:36, 18 November 2017 (UTC)
- @Johnuniq: Any chance it could also cope with degraded situations like "March 1952" or even just "1952"? E.g. see [1]. Thanks. Mike Peel (talk) 15:51, 19 November 2017 (UTC)
- Module:Age uses the term "partial" to refer to an incomplete date such as "March 1952" or "1952". Template:Age works with full dates only because it produces a single number as the result (or an error). The result is the number of full elapsed years. For example, from 1 January 2010 to 31 December 2011 is an age of 1 year. By contrast, {{age in years}} accepts partial dates and produces either a single number or a range of numbers.
- I just used the module for {{age in years/sandbox}}.
{{age in years/sandbox|1 Apr 2010|1 May 2011}}
→ 1{{age in years/sandbox|May 2010|Apr 2011}}
→ 0{{age in years/sandbox|Apr 2010|May 2011}}
→ 1{{age in years/sandbox|Apr 2010|Apr 2011}}
→ 0–1{{age in years/sandbox|Apr 2010|2011}}
→ 0–1{{age in years/sandbox|2010|2011}}
→ 0–1
- There are some quirky differences between "age" and "age in years". The former gives a negative result if the first date is after the second date, while the latter regards a negative result as an error. The module is happy to give either result (negative is ok or is an error) but for compatibility it does what the current templates do. A difference between the module and the current templates is that the module gives an error if an input is invalid (31 April 2017 is an error), while the templates give odd results with invalid inputs. Examples from here and here:
{{age|1994|13|2|2016|20|8}}
→ 22 (output from old template){{age|19866|06|22}}
→ -17849 (output from old template)
- I won't post the sandbox equivalent because it gives an ugly red error message for both.
- Johnuniq (talk) 03:52, 20 November 2017 (UTC)
@Mike Peel: This template has been updated to use Module:Age with a few changes from our above discussion. The default allows partial dates such as May 2010 (no day) or 2010 (no month and no day). Having no year, or having a day with no month is an error. Examples:
{{age|1952|3|11|2001|5|11}}
→ 49{{age|1952|3|11|2001|5|11}}
→ 49{{age|11 March 1952|11 May 2001}}
→ 49{{age|11 MAR 1952|11 May 2001}}
→ 49{{age|March 11, 1952|2001-5-11}}
→ 49{{age|1 Apr 2010|1 May 2011}}
→ 1{{age|May 2010|Apr 2011}}
→ 0{{age|Apr 2010|May 2011}}
→ 1{{age|Apr 2010|Apr 2011}}
→ 0–1{{age|Apr 2010|2011}}
→ 0–1{{age|2010|2011}}
→ 0–1
Warning: Per discussion below, when only one date is entered, the current date is used for the other date. The template outputs a span that can be used by a calling infobox to detect if only one date was used. The following shows two examples with the wikitext that is produced if the current date is in 2018.
{{age|2010}} → <span class="currentage"></span>8 {{age|format=raw|2010}} → 8
@Mike Peel: I posted the above on 7 May 2018 but failed to sign so you would not have been pinged. I'm pinging you now in case the above is of interest. Johnuniq (talk) 09:51, 17 May 2018 (UTC)
Detecting if the 4/5/6 parameters are used
editsome templates, like {{fb in2 player}} and {{fb out2 player}}, are passed this template to show the age of the player at time of signing. unfortunately, frequently only the first 3 parameters are used, so the displayed age is the current age, and not the age at time of signing. would it be possible/feasible to add an extra <span>...</span>
or something that I could string process to detect this problem? something like <span class="currentage">
which could be an empty span if it's the age at a specified date instead? or, the reverse with say <span class="ageatdate">
? or anything else that I could use to detect this? thank you. Frietjes (talk) 15:00, 23 April 2018 (UTC)
- You have probably seen my painfully slow attempt to migrate many of the age templates to use Module:Age. That module can handle this template but the module shows an ugly error message if a date is invalid, and there are often invalid dates. The module could output something extra to indicate whether one or two dates were used. IMHO the ideal solution would be to use separate templates: one that required a single date, and one that required two. That way there would be no ambiguity. Meanwhile, please outline what happen next so I understand more of the picture. Say this template outputs a hidden something if only one date is used. What would happen next? The calling template would do what? Johnuniq (talk) 02:31, 24 April 2018 (UTC)
I found my notes on the errors using {{age}} from the November 2017 dump of articles. There were 746 of them. Examples:
- List of rampage killers (Americas)
{{age|1904|99|99|1932|01|02}}
→ 27 (output from old template) - Roman Catholic Diocese of Foligno
{{age|0|0|00}}
years ago → 2023–2024 years ago - University of Piura
{{age|4|7|1969}})
→ 2013 (output from old template)
Using the module, these fixes would be needed:
{{age/sandbox|1904|2 Jan 1932|range=no}}
→ 28{{age/sandbox|1 Jan 1 BCE}}
→ 2024{{age|1969|4|7}}
→ 55 —or—{{age/sandbox|April 7, 1969}}
→ 55
Using range=yes
would show a range of possible ages if partial dates are given (range=yes
is saying "I know I did not enter full dates so don't show an error"). Using range=no
says the same but a range is not shown, only the larger age. Johnuniq (talk) 05:42, 24 April 2018 (UTC)
- There are under a thousand {{Fb in2 player}} and {{Fb out2 player}} transclusions so another approach might be to bot edit articles to split the age parameter into birth date and transfer date. The template could then pass that to {{age}}. If feasible, the dates could be changed from, for example,
|2004|5|18
to|2004-5-18
(changing three parameters to a single parameter), and the two single dates could be passed to {{age/sandbox}}. Johnuniq (talk) 07:53, 24 April 2018 (UTC)
@Frietjes: I am planning to change this template to use the module soon. However, there are 590 occurrences in articles with invalid dates so a lot of fixing will be needed to remove errors when the module is used. There are many more occurrences with a zero month or day to indicate an unknown value—currently the module would reject them as invalid. I've been thinking about that and have decided to edit the module to accept such dates because zero is handy to indicate unknown and zero doesn't significantly affect age in years. So, have you decided what you need? I could add that while making my planned change. Johnuniq (talk) 08:06, 3 May 2018 (UTC)
- Johnuniq, any way to detect that the age is not a static quantity when parsing the output would work for me. I don't have any strong opinion on the format of the "marker" or "tag" used. thank you. Frietjes (talk) 11:29, 3 May 2018 (UTC)
@Frietjes: Please test using {{age/sandbox}}. Using Special:ExpandTemplates shows:
{{age/sandbox|2001|1|2}} → <span class="currentage">17 {{age/sandbox|2001|1|2|2008|3|4}} → 7 {{age/sandbox|2001|0|0|2008|3|4}} → 7 {{age/sandbox|2001|1|2|2008|0|0}} → 7 {{age|2001|1|2|2008|0|0}} → 6 (different from what module will do)
I made it accept zero as an unknown month or day and output the span if the current date is used. That means a fair bit of extra HTML will appear in articles—I guess that's ok. The last example shows that the module works differently from the current template when the "as at" date is unknown. Johnuniq (talk) 05:43, 4 May 2018 (UTC)
- OMG I got lost in the module code and overlooked the fact that the span needs to be closed. Please provide the exact wikitext that should be output. Something like
<span class="currentage"></span>17
? Johnuniq (talk) 10:35, 4 May 2018 (UTC)- Johnuniq, that works, or maybe better to put the closing tag on the other side of the age. although now I am wondering if any templates/modules uses the output in an '#expr:'? I suppose we would find out pretty quickly with errors popping up in the expression error tracking category. Frietjes (talk) 11:55, 4 May 2018 (UTC)
- just fixed this one :) Frietjes (talk) 15:43, 4 May 2018 (UTC)
@Frietjes: I updated the module to close the span. It was easier to put it all in front of the age so that's what I did. That is similar to the output from {{anchor}}. I searched a dump of articles from February 2018 and the only ones using {{age}} in #expr appear to be:
- Phil Ramone
{{#expr:{{age|1982|10|01}}+1982}}
→ 2017 (output from old template)
- Neal Smatresk
{{cardinal to word|{{#expr: {{age|1981|09|01}}/{{age|1951|7|9}}*100 round 0 }}}}
→ fifty-five (output from old template)
- The Music Trades (magazine)
{{Cardinal to word|{{#expr:{{#expr:trunc{{age|1929|07|19}}/trunc{{age|1891|01|03}}}}*100 round 0}}}}
→ sixty-nine (output from old template)
Some of that could be solved by deleting puffery but a quieter solution would be to add |format=raw
which forces the template to output a plain number with no span. Please test using {{age/sandbox}}. If you find that it does what you need I can switch age to use the module. However, there are around 570 invalid dates in articles and I hope you will be able to help clear Category:Age error! Johnuniq (talk) 03:58, 5 May 2018 (UTC)
- Johnuniq, looks fine to me, so long as we have a plan for fixing the articles listed above (and any others that might pop up). one easy way to fix it would be to have an option to not output the
<span>...</span>
, but better would probably to be to reduce the horrible article markup. Frietjes (talk) 14:22, 5 May 2018 (UTC)- @Frietjes: Use
{{age|format=raw|2000|1|2}}
to output a plain number with no span. I changed the template to use the module and will need help fixing errors seen at Category:Age error and possibly Category:ParserFunction errors. Johnuniq (talk) 01:21, 6 May 2018 (UTC) - I asked at WikiProject Football for help cleaning Category:Age error. There have also been many errors in Category:ParserFunction errors that have needed
|format=raw
to fix. Johnuniq (talk) 11:22, 6 May 2018 (UTC)- Johnuniq, I modified ConvertNumeric, which is used by
{{number to word}}
. if{{cardinal to word}}
and{{ordinal to word}}
used Module:ConvertNumeric we would have most of them fixed. I think{{number to word}}
covers both cases if you used|
? I am pretty sure I know who added all of these based on the number of userspace errors :) Frietjes (talk) 13:25, 6 May 2018 (UTC) - Johnuniq, another idea would be to have
{{number to word|{{Age|2013|10|01}}}}
be the same as{{Age|2013|10|01|format=cardinal}}
and{{number to word|{{Age|2013|10|01}}|ord=on}}
be the same as{{Age|2013|10|01|format=ordinal}}
. it looks like the Module:ConvertNumeric as exposed subfunctions that you could use. Frietjes (talk) 13:35, 6 May 2018 (UTC)- Brilliant! I'll look at that. Thanks for cleaning up some of the user space stuff too...it's an irritating distraction. Johnuniq (talk) 01:21, 7 May 2018 (UTC)
- Johnuniq, I modified ConvertNumeric, which is used by
- @Frietjes: Use
@Frietjes: I put some code in the sandbox. Please try it out.
{{age/sandbox|1898|01|01|2018|02|01|format=cardinal}}
→ one hundred and twenty{{age/sandbox|1898|01|01|2018|02|01|format=cardinal_us}}
→ one hundred twenty{{age/sandbox|1898|01|01|2018|02|01|format=Cardinal}}
→ One hundred and twenty{{age/sandbox|1898|01|01|2018|02|01|format=Cardinal_us}}
→ One hundred twenty{{age/sandbox|1898|01|01|2018|02|01|format=Ordinal}}
→ One hundred and twentieth{{age/sandbox|1898|01|01|2018|02|01|format=Ordinal_us}}
→ One hundred twentieth{{age/sandbox|1898|01|01|2018|02|01|format=ordinal}}
→ one hundred and twentieth{{age/sandbox|1898|01|01|2018|02|01|format=ordinal_us}}
→ one hundred twentieth{{age/sandbox|1980|1990|range=yes|format=Cardinal}}
→ Nine or ten{{age in years, months and days/sandbox|April 1980|1995|format=Cardinal|range=yes}}
→ Fourteen or fifteen years
Johnuniq (talk) 10:09, 12 May 2018 (UTC)
- Johnuniq, looks great! Frietjes (talk) 15:00, 13 May 2018 (UTC)
- I have updated the main module so it can be tried. Johnuniq (talk) 03:27, 14 May 2018 (UTC)
MOS:RELTIME
edit@CapnZapp: A recent edit to the documentation suggests this template is being used in ways that contradict MOS:RELTIME. The change needs work for two reasons. First, there is no "policy" related to use of the template, there is only a MOS guideline. Guidelines are important but documentation should use correct terminology. Second, it is not very helpful to suggest that people using this template should consult relevant stuff without spelling out what the problem is. Everything gets misused occasionally but I haven't noticed such problems with {{age}}. Please post some examples here. Johnuniq (talk) 11:02, 22 September 2018 (UTC)
- Thank you for your reply. Yes, I consider my edit a "first stab" and feel free to improve further. My specific example: [2]. As I understand policy the fact this template can be used to avoid manual maintenance is no reason to not avoid such phrases in the first place. That said, I am sure this template has its valid usages. But the documentation should IMHO address this and not merely be about technical issues (syntax etc). CapnZapp (talk) 11:54, 22 September 2018 (UTC)
- I came here to say "thanks for bringing this to talk", User:Johnuniq. But I see it's already been brought to talk. So when you (today) say "see talk" do you mean someplace else than here? CapnZapp (talk) 12:15, 24 April 2019 (UTC)
- I meant here as per my above comment. This concerns Template:Age/doc and this edit from September 2018 which said that relevant Wikipedia policies and Manual of Style sections should be read before using {{age}} in articles, with a link to MOS:RELTIME. The example above is diff where someone had written
- More than {{age|1989|6|5}} years after the incident, there is ...
- It's true that such usage is unwise but people misuse everything including standard English. The documentation here has to focus on providing useful advice and telling people to read relevant policies and MOS sections is not helpful. The advice at MOS:RELTIME is too avoid wording such as "17 years ago". Referring people to that section is very unlikely to help avoid problems like that. If someone objected to "More than {{age|1989|6|5}} years..." being removed, they should be directed to MOS. Pointing them to a statement here that they should not do that would not help.At any rate, it's fine by me if you want to work on some useful advice for the documentation, but please make it focus on telling people what to do (or what not to do). I recently inspected the page because I was wondering whether anything would need updating for the fact that the method used for hidden sort keys will change soon (see Module talk:Age#Sorting will use data-sort-value). Johnuniq (talk) 23:59, 24 April 2019 (UTC)
- Okay we're running on two parallell tracks here. On one hand you are clearly attempting to communicate, on the other you're merely reverting with no effort to improve, just delete. When you say "I meant here as per my above comment" you must have failed to see that I had already seen it and responded to it. Logically, that means it is your turn, and I don't mean "just read my previous comment until you stop disagreeing with it". But in good faith, I see you are a prolific contributor - maybe you just got distracted with something else and did not intend to come across as overbearing and uncommunicative?
- I meant here as per my above comment. This concerns Template:Age/doc and this edit from September 2018 which said that relevant Wikipedia policies and Manual of Style sections should be read before using {{age}} in articles, with a link to MOS:RELTIME. The example above is diff where someone had written
- I came here to say "thanks for bringing this to talk", User:Johnuniq. But I see it's already been brought to talk. So when you (today) say "see talk" do you mean someplace else than here? CapnZapp (talk) 12:15, 24 April 2019 (UTC)
So, let's start over. What specific phrasing would you suggest that asks the user to avoid using the age templates for "17 years ago" style phrasings. What I'm after is that just saying "it's already recommended against" is not enough. Mainly because that's in a guideline somehwere and not right here in the template documentation. I am proposing that this documentation remind the community to avoid such phrasings (with or without template aid). To be blunt, the core of what I want to say is: Using the templates doesn't make it okay. Now then :) Can I ask you to constructively come up with a example paragraph (just an outline is quite okay) so we can leave the stage where I propose things only for you to tell me what's wrong with them. Me seeing my edits get reverted is not a good use of my time. I look forward to your ideas. CapnZapp (talk) 07:23, 25 April 2019 (UTC)
- I doubt whether there is any template that cannot be misused. For example, someone might add {{convert}} to an article with values they thought were appropriate but which in fact were unverifiable or undue. Should the documentation for convert tell people they must comply with relevant policies and guidelines when using the template? I don't think that highlighting MOS:RELTIME here would have any practical benefit but if it were wanted a paraphrase of what it says might be best. That is because a documentation page should focus on giving advice about what to do (or not do). Johnuniq (talk) 10:51, 25 April 2019 (UTC)
- Please do not relativize. No template cannot be misused, sure, that's a fact. But it also is an argument used to block change, any change. In fact, it is unassailable truth that does not lend itself to working out compromise between two positions. Therefore you will excuse me if I don't engage in your hypotheticals. I again ask that you take the small step of giving me even a hint of what you would find acceptable. Just a mere idea or draft is enough.
- Okay you don't think linking to RELTIME is useful. Fair enough. What then to do? As long as the basic gist gets across I'm happy - that prospective users are reminded not to write "17 years ago" sentences; just because the templates ease the maintenance load of writing such sentences doesn't mean there's a green light to do it. This stuff belongs nowhere else but here. CapnZapp (talk) 11:50, 25 April 2019 (UTC)
- The text after "if it were wanted" gives more than a hint. Other stuff exists would normally rule out consideration of other templates but my real point is that I know of only one example (yours above) where this template was used in contravention of RELTIME and any documentation here is not going to affect a tiny amount of misuse. Johnuniq (talk) 01:37, 26 April 2019 (UTC)
- If all of this boils down to you objecting to any addition at all, User:Johnuniq, you really need to come out and say so. I don't have time to play games. You don't get to give me hints. I sure as hell am not about to come up with suggested phrasings if you have no intention of letting any of them through. So what is it going to be? CapnZapp (talk) 21:02, 27 April 2019 (UTC)
- I'm responding due to a message at my talk but all I can do is clarify what I wrote above. I do not think that changing the documentation here will help with the problem reported. However, if wording were wanted, it should use "guideline" not "policy", and should paraphrase MOS:RELTIME. That is, a section might be "When to use" or "Guideline" or similar, with text saying
Do not use this template to show wording such as "17 years ago". Instead, write "in 2007" per MOS:RELTIME.
I copied the wikitext from the guideline so the year will always be correct. Johnuniq (talk) 09:44, 29 April 2019 (UTC)
- I'm responding due to a message at my talk but all I can do is clarify what I wrote above. I do not think that changing the documentation here will help with the problem reported. However, if wording were wanted, it should use "guideline" not "policy", and should paraphrase MOS:RELTIME. That is, a section might be "When to use" or "Guideline" or similar, with text saying
- If all of this boils down to you objecting to any addition at all, User:Johnuniq, you really need to come out and say so. I don't have time to play games. You don't get to give me hints. I sure as hell am not about to come up with suggested phrasings if you have no intention of letting any of them through. So what is it going to be? CapnZapp (talk) 21:02, 27 April 2019 (UTC)
- The text after "if it were wanted" gives more than a hint. Other stuff exists would normally rule out consideration of other templates but my real point is that I know of only one example (yours above) where this template was used in contravention of RELTIME and any documentation here is not going to affect a tiny amount of misuse. Johnuniq (talk) 01:37, 26 April 2019 (UTC)
Display issue?
editLooking at the template page here, I see "0" displaying at the top of the page (immediately above the Template Documentation box) rather than "{{Age}}". Can this be corrected? Muzilon (talk) 20:44, 3 February 2021 (UTC)
- It's showing 0 because that is the output from
{{age}}
(no parameters). It could be fixed by inserting includeonly tags if someone wanted to do that. There is an example at {{val}}. Johnuniq (talk) 02:30, 4 February 2021 (UTC)- I made the change so the confusing "0" is no longer displayed. Johnuniq (talk) 06:12, 6 February 2021 (UTC)
"Template:年数" listed at Redirects for discussion
editA discussion is taking place to address the redirect Template:年数. The discussion will occur at Wikipedia:Redirects for discussion/Log/2021 February 25#Template:年数 until a consensus is reached, and readers of this page are welcome to contribute to the discussion. –LaundryPizza03 (dc̄) 17:01, 25 February 2021 (UTC)
Change to automatic update
editAs time passes, that date will naturally becomes outdated. Date 'July 23, 1989' was written in 2006. It was almost 17 years ago, isn't that too outdated? Which is the better way to renew? Automatic update when day passes or replacing it with more recent dates? Anyone support with the date change when time passes? Windywalk (talk) 18:18, 26 May 2023 (UTC)
- This relates to your edits at Template:Age/doc. I don't think there is a problem with old dates such as 1989 and precise numbers might have been chosen to illustrate some point about how the template works. However, your changes seem fine although I haven't studied them. Johnuniq (talk) 23:16, 26 May 2023 (UTC)
- It's not too old date yet, but it could be a problem if it persists decades later. What do you think of the auto-renewal dates when time passes? Including {{#expr: {{CURRENTYEAR}} - 18}} in template; {{age|2006|11|17|2021|7|1}} Windywalk (talk) 15:22, 28 May 2023 (UTC)
- I don't mind, I just don't think there is a problem with old dates. However, YMMV. Johnuniq (talk) 02:03, 29 May 2023 (UTC)
- I see zero problems with our documentation using the following example even fifty years in the future:
- I don't mind, I just don't think there is a problem with old dates. However, YMMV. Johnuniq (talk) 02:03, 29 May 2023 (UTC)
- It's not too old date yet, but it could be a problem if it persists decades later. What do you think of the auto-renewal dates when time passes? Including {{#expr: {{CURRENTYEAR}} - 18}} in template; {{age|2006|11|17|2021|7|1}} Windywalk (talk) 15:22, 28 May 2023 (UTC)
{{age|1989|7|23|2003|7|14}}
→ 13- Regards, CapnZapp (talk) 13:53, 29 May 2023 (UTC)
30 years in the future{{age|1989|7|23|2053|7|14}}
→ 63
Windywalk (talk) 10:10, 30 May 2023 (UTC)
I should note, this user brought the exact same thing up on both SmashWiki and MarioWiki. They only brought it because they believe getting it changed on Wikipedia would get it changed on the other two sites, which is not how it works, as no one on both wikis have agreed to their changes. Not to mention, it's such a trivial and pointless change that I don't understand why it's being dragged across 3 different wikis and for over a week now. Cookies And Creme (talk) 17:09, 1 June 2023 (UTC)
- I'll take note and understand. I will should stop obsessed with this template across multiple wikis. This obsession started last April when I failed to make the age template up to date. Windywalk (talk) 17:21, 1 June 2023 (UTC)
Inaccurate age shown
editI know that I fixed this error at some point for one or more of the age templates, so I don't know if this is a new error, a regression, or something I fixed at a different template. Here's an example:
{{age|December 31, 1840|1925}}
→ 84–85
This example currently outputs "85", which is highly unlikely to be correct. The correct output should be "84–85". An example with a full date in parameter 2 gets it right ("84"):
{{age|December 31, 1840|May 1, 1925}}
→ 84
I don't know enough Lua to fix this problem. – Jonesey95 (talk) 17:37, 5 June 2023 (UTC)
- That is a design decision for {{age}} which can be overridden with the
range
parameter (see the documentation at Module:Age):{{age|December 31, 1840|1925|range=yes}}
→ 84 or 85{{age|December 31, 1840|1925|range=dash}}
→ 84–85
- I forget why {{age}} behaves like that but I emulated the old behavior when implementing the templates in the modules. I think it was something to do with the fact that there are quite a lot of historical age ranges where one date is known but the other is not and showing ranges by default seemed to be undesirable? Johnuniq (talk) 23:16, 5 June 2023 (UTC)
- I propose setting
|range=dash
as the default in order to avoid showing erroneous ages. – Jonesey95 (talk) 16:52, 8 June 2023 (UTC)- That's fine by me and easy to do. I'm a little nervous in that I don't recall why it behaves this way and I have a tiny feeling that there was a good reason. Do you know of an article where this would make a difference? I wonder if there is a place where others have an opinion, or, we could just make the change and see if there is any pushback. Johnuniq (talk) 22:23, 8 June 2023 (UTC)
- I proposed the change at Template talk:Infobox person#Template:Age. Johnuniq (talk) 02:29, 9 June 2023 (UTC)
- That's fine by me and easy to do. I'm a little nervous in that I don't recall why it behaves this way and I have a tiny feeling that there was a good reason. Do you know of an article where this would make a difference? I wonder if there is a place where others have an opinion, or, we could just make the change and see if there is any pushback. Johnuniq (talk) 22:23, 8 June 2023 (UTC)
- I propose setting
- What astounding bureaucracy. I was led here from a link at WT:MOSBIO#Age of person in an infobox, which pointed me to Template talk:Infobox person#Template:Age (although it appears to have nothing to do with infoboxes, and everything to do with the
{{Age}}
template), which finally gets me here at Template_talk:Age. What can't we just (and really, why haven't we already just gone ahead to) change Template:Age to behave identically to Template:BirthDeathAge, which already does things like "August 8, 1990 (aged 13–14)"? All of these templates should behave that way, if they don't already, and I was surprised to see that{{Age}}
apparently doesn't. — JohnFromPinckney (talk / edits) 11:50, 9 June 2023 (UTC)- {{age}} is used in 36,000 articles (mainly in infoboxes) and I don't like the idea of changing how a template has behaved for many years without prior notice. I haven't thought much about the template for five years but I seem to recall there being a reason for why age behaves as it does. I could be mistaken. Johnuniq (talk) 23:22, 9 June 2023 (UTC)
I have updated Module:Age so range=dash is now the default for {{age}}. Johnuniq (talk) 07:29, 11 June 2023 (UTC)
- Shouldn't there be a formal RfC on this? voorts (talk/contributions) 20:02, 11 June 2023 (UTC)
- I would be happy with that but see "astounding bureaucracy" above for a contrary view. This was mentioned with clear examples at Template talk:Infobox person#Template:Age and WT:Manual of Style/Infoboxes#Age of person in an infobox and WT:Manual of Style/Biography#Age of person in an infobox by 03:54, 9 June 2023. That's 50 hours before implementation. The only feedback has been here. Please start an RfC in a new section (at one of the manual of style pages?) if there is concern that the change has caused problems. Johnuniq (talk) 23:57, 11 June 2023 (UTC)
Examples where range=dash makes a difference
editI've examined the April 2023 dump of articles. About 2,100 instances of {{age}} in articles would show a dash if |range=dash
becomes the default. If wanted, |range=no
could be added to remove the dash. Typical examples are:
- University of Sydney#Notable alumni • for the past 173 years • (would become 172–173 years)
- List of Chinese by net worth#2022 Chinese billionaires top 100 list • most entries would have a dash in the age, for example, 75–76 instead of 76
- Indoor American football#Current leagues • 2008–present (15 years) • (would become "2008–present (14–15 years)")
University of Sydney has "established = {{start date and age|1850}}" in the infobox. That uses {{start date and age}} (not {{age}}) and displays "Established 1850; 173 years ago" with no dash.
I'll update the module soon but thought I would post this attempt to remind myself why {{age}} currently defaults to no dash. Johnuniq (talk) 04:35, 11 June 2023 (UTC)
Two year ranges
editWhen there is a year range such as birth_date = 1943 or 1944 (age {{age|1944}}–{{age|1943}})
this now shows "79–80–80–81" but just adding range=no
doesn't quite work as that shows "80–81" whereas it would be better to show "78–80". What options are there for cases like these? -- WOSlinker (talk) 08:18, 11 June 2023 (UTC)
- Sorry, there is nothing to handle that. An ugly kludge would be:
(age {{age|1944-12-31}}–{{age|1943-1-1}})
→ (age 79–81)
- If there are many like that, it might be necessary to invent new syntax in probably a new template. Johnuniq (talk) 09:14, 11 June 2023 (UTC)
- There were a few I've fixed but there's also 37 to look at. -- WOSlinker (talk) 23:08, 11 June 2023 (UTC)
- I've create {{age range}} for this. -- WOSlinker (talk) 18:25, 14 June 2023 (UTC)
- Thanks. Johnuniq (talk) 22:27, 14 June 2023 (UTC)
- I've create {{age range}} for this. -- WOSlinker (talk) 18:25, 14 June 2023 (UTC)
- There were a few I've fixed but there's also 37 to look at. -- WOSlinker (talk) 23:08, 11 June 2023 (UTC)