Template talk:Age

message: some templates, like  and , 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  or something that I could string process to detect this problem?  something like  which could be an empty span if it's the age at a specified date instead?  or, the reverse with say ?  or anything else that I could use to detect this?  thank you. Frietjes (talk) 15:00, 23 April 2018 (UTC)
replies: text: 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)

text: There are under a thousand  and  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 . 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 . Johnuniq (talk) 07:53, 24 April 2018 (UTC)

text: 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)

text: 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 17? Johnuniq (talk) 10:35, 4 May 2018 (UTC)
replies: text:  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)

text:  just fixed this one :) Frietjes (talk) 15:43, 4 May 2018 (UTC)

text: 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 , but better would probably to be to reduce the horrible article markup. Frietjes (talk) 14:22, 5 May 2018 (UTC)
replies: text: @Frietjes: Use  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)

text: 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)
replies: text: Johnuniq, I modified ConvertNumeric, which is used by .  if  and  used Module:ConvertNumeric we would have most of them fixed.  I think  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)

text: Johnuniq, another idea would be to have  be the same as  and  be the same as .  it looks like the Module:ConvertNumeric as exposed subfunctions that you could use. Frietjes (talk) 13:35, 6 May 2018 (UTC)
replies: text: 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)

text: Johnuniq, looks great! Frietjes (talk) 15:00, 13 May 2018 (UTC)
replies: text: I have updated the main module so it can be tried. Johnuniq (talk) 03:27, 14 May 2018 (UTC)
thread_title:  Detecting if the 4/5/6 parameters are used 

message: Looking at the template page here, I see "0" displaying at the top of the page (immediately above the Template Documentation box) rather than "". Can this be corrected? Muzilon (talk) 20:44, 3 February 2021 (UTC)
replies: text: It's showing 0 because that is the output from  (no parameters). It could be fixed by inserting includeonly tags if someone wanted to do that. There is an example at . Johnuniq (talk) 02:30, 4 February 2021 (UTC)
replies: text: I made the change so the confusing "0" is no longer displayed. Johnuniq (talk) 06:12, 6 February 2021 (UTC)
thread_title:  Display issue? 

message: A 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)
thread_title:  "Template:年数" listed at [[Wikipedia:Redirects for discussion|Redirects for discussion]] 

message: I've examined the April 2023 dump of articles. About 2,100 instances of  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 • 
*List of Chinese by net worth#2022 Chinese billionaires top 100 list • 
*Indoor American football#Current leagues • 2008–present (15 years) • 
University of Sydney has "established = " in the infobox. That uses  (not ) 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  currently defaults to no dash. Johnuniq (talk) 04:35, 11 June 2023 (UTC)
thread_title:  Examples where range=dash makes a difference