Jump to content

Template talk:Start date and age

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

Removal of {{Error}}

[edit]

Wbm1058, to answer the question in Special:Diff/1099411584 – the problem is visible on every page that uses it. Please take a look at Template:Start date and age/testcases. —⁠andrybak (talk) 16:52, 20 July 2022 (UTC)[reply]

Thanks andrybak. Sorry I did not check the test cases. My bad. wbm1058 (talk) 16:57, 20 July 2022 (UTC)[reply]
Doh. I removed {{error but neglected to remove the closing }}wbm1058 (talk) 17:04, 20 July 2022 (UTC)[reply]

I have a change ready in the sandbox which will just return blank when parameters 1, 2, and 3 are all missing. Editors are pulling Wikidata to use for this template's parameters and often there is no date in Wikidata. This is considered "normal" so returning an error has been problematic. For example in the Python (programming language) infobox. I was reverted after I removed Wikidata-filled parameters where Wikidata was not returning any "latest preview date". See the relevant test cases. The new behavior is to only show the error when parameter 1 is missing and parameter 2 and/or 3 are not missing. If there are no timely objections I will make the sandbox code go live. – wbm1058 (talk) 18:22, 20 July 2022 (UTC)[reply]

Template-protected edit request on 26 April 2023

[edit]

I think we need prehistoric years (0BC and before) to be included. 50.39.178.57 (talk) 03:56, 26 April 2023 (UTC)[reply]

 Not done for now: please establish a consensus for this alteration before using the {{Edit template-protected}} template. BilCat (talk) 04:03, 26 April 2023 (UTC)[reply]
Also: (i) there is no such year as 0BC - the year before AD 1 is 1 BC; (ii) that is not the meaning of "prehistoric". --Redrose64 🌹 (talk) 16:21, 26 April 2023 (UTC)[reply]
It's possible to use a negative year:
-2833; 4858 years ago (-2833)
But "2833 BC" as output would be better. --Kallichore (talk) 21:01, 26 April 2023 (UTC)[reply]
 Not done. This is a documented limitation of the template, for reasons outside of the template's control. – Jonesey95 (talk) 22:39, 26 April 2023 (UTC)[reply]

Use outside infoboxes

[edit]

Template:Start date#When not to use this template explicitly states that it is not to be used outside microformat-emitting templates or table rows. Does the same restriction apply here? If so, why isn't it documented? --Redrose64 🌹 (talk) 22:22, 10 August 2024 (UTC)[reply]

Wrong output

[edit]

Hi, for article Python (programming language) and in the Infobox and in "Stable release" part, the output is:

3.12.6 / 7 September 2024; 16 days ago

which is the output of this code:

| latest release date = {{start date and age|{{wikidata|qualifier|single|P548=Q2804309|P348|P577}}}}

there is 18 days between 25th September (today) and 7th of September of 2024 (the argument from Wikidata). Here the output of this template is wrong. Please inspect. Thanks, Hooman Mallahzadeh (talk) 07:44, 25 September 2024 (UTC)[reply]

@Hooman Mallahzadeh: It says 18 days ago. I do not see what the problem is. --Redrose64 🌹 (talk) 17:00, 25 September 2024 (UTC)[reply]
@Redrose64 It is probably due to caching mechanism. The output of this template is the cached output. Until the cache is not cleared, the value is wrong. For myself, the output updated to 18 days, which is related to yesterday. Correct output for today is 19 days. We should use some mechanism to avoid caching for this template. Hooman Mallahzadeh (talk) 03:56, 26 September 2024 (UTC)[reply]
@Hooman Mallahzadeh: Did you try a WP:PURGE before posting here? --Redrose64 🌹 (talk) 14:59, 26 September 2024 (UTC)[reply]
@Redrose64 This behavior for this template causes wrong output in ordinary applications that no purge is done in ordinary browsers like FireFox. Is there any way to correct output of the template without purging? Hooman Mallahzadeh (talk) 15:04, 26 September 2024 (UTC)[reply]
No, because it's not caused by this template - it's because the MediaWiki software doesn't reparse pages on the offchance that {{CURRENTYEAR}} etc. (see Help:Magic words#Current_date_and_time) might have changed since the last time that the page was parsed. It's also nothing to do with the browser, because purging is performed server-side not client-side. --Redrose64 🌹 (talk) 21:05, 26 September 2024 (UTC)[reply]

change to df=yes as default

[edit]

According to List of date formats by country there are much more countries with a sane date format and kind of only the USA with MDY. I propose to change the df= parameter to yes by default instead of the current default (no). 2003:F1:CF4C:9300:8590:24D7:57DD:A77F (talk) 11:47, 15 December 2024 (UTC)[reply]

I agree, and this should also be applied to {{End date and age}}, {{Birth date and age}}, {{Death date and age}}, and possibly others. -- Michael Bednarek (talk) 12:44, 15 December 2024 (UTC)[reply]
I am also in favour of that. As Michael mentioned this should also be changed in the other templates. 2A02:3036:206:65CA:8888:9AD2:A4A0:79C6 (talk) 22:22, 16 December 2024 (UTC)[reply]

Issue with year off by one within "Infobox radio station" template

[edit]

I noticed this problem within page KXTG. The "infobox radio station" template has an entry for "airdate" which in this page is set as "Start date and age|1926|12|13}} (as KXL)" A page update for November 1, 2024 at: https://en.wikipedia.org/w/index.php?title=KXTG&oldid=1258821856 correctly listed this as 98 years ago. But a small change later that same day, which is still active, at: https://en.wikipedia.org/w/index.php?title=KXTG&oldid=1258871347 now lists this, in the template as well as the body of the page, as 97 years ago. - Thomas H. White (talk) 16:00, 15 December 2024 (UTC)[reply]

Both show 98 years ago for me. --Redrose64 🌹 (talk) 17:42, 15 December 2024 (UTC)[reply]
Both also show 98 years for me now - Thomas H. White (talk) 19:03, 15 December 2024 (UTC)[reply]
@Thomas H. White: For future ref, if this happens again, try a WP:PURGE. Maybe somebody did that between your original post and my reply. --Redrose64 🌹 (talk) 20:02, 15 December 2024 (UTC)[reply]

Unknown parameter cleanup

[edit]

@Primefac, could you run your bot please on Category:Pages using start date and age with unknown parameters and Category:Pages using Template:End date and age with unknown parameters and remove the |mf= parameter? Gonnym (talk) 12:07, 16 March 2025 (UTC)[reply]

Sure. Primefac (talk) 22:48, 16 March 2025 (UTC)[reply]

Error: All values must be integers

[edit]

Lots of articles with this error, especially in software article infoboxes, examples:

Python_(programming_language) Gedit

https://en.wikipedia.org/w/index.php?search=%22All+values+must+be+integers%22&title=Special%3ASearch&profile=advanced&fulltext=1&ns0=1

Was something changed? 213.186.231.42 (talk) 10:28, 17 March 2025 (UTC)[reply]

Yes, the backend of the template now uses Module:Date time to validate the data. The template always expected numbers, split into different parameters, it now just gives an error indicating that. Gonnym (talk) 10:34, 17 March 2025 (UTC)[reply]

Someone needs to update the Template documentation to reflect this seeing this issue everywhere they didnt even try to change it ahead of time Isla🏳️‍⚧ 10:40, 17 March 2025 (UTC)[reply]

What's the recommended fix for this? e.g. where it has

   latest release date    = {{start date and age|{{wikidata|qualifier|P348|P577}}}}

what should this be changed to (or is it something that can be changed in the template itself?)

157.231.213.86 (talk) 10:52, 17 March 2025 (UTC)[reply]

I tried in one article and this seems to work
  | latest release date = {{Start date and age
  | {{#time: Y | {{wikidata|qualifier|preferred|single|P348|P548=Q2804309|P577}} }}
  | {{#time: n | {{wikidata|qualifier|preferred|single|P348|P548=Q2804309|P577}} }}
  | {{#time: j | {{wikidata|qualifier|preferred|single|P348|P548=Q2804309|P577}} }}
  | df = yes
}}

213.186.231.42 (talk) 11:08, 17 March 2025 (UTC)[reply]

I've reverted my changes for now, but to answer your question, there doesn't seem to be a fix for that with the current templates. The wikidata returns one string. This produces code that visually looks like it works, but in practice does not produce a valid ISO 8601 string which is the only reason to use this template. If a template is wanted that only produces a visual "time ago" number, then {{Time ago}} is the template that should be used. Gonnym (talk) 11:58, 17 March 2025 (UTC)[reply]

About recent template changes

[edit]

Gonnym changed the date and age templates, including this one, which caused the "All values must be integers" error to appear on over 2000 pages; now I have to edit some of them myself as there's no automatic way to fix it yet. Purplneon486 (talk) 11:35, 17 March 2025 (UTC)[reply]

I've reverted my changes. I'm sorry that my 1000 pages of fixes so far is not fast enough. Gonnym (talk) 11:56, 17 March 2025 (UTC)[reply]
I think considering the number of pages effected it'd make sense to make the changes to the pages first and then change the template. --Caliburn · (Talk · Contribs · CentralAuth · Log) 11:58, 17 March 2025 (UTC)[reply]
It would make even more sense if a changed template would deal with parameters the same way the previous template did. Many templates accept a variety of date formats – it's not rocket science. -- Michael Bednarek (talk) 12:38, 17 March 2025 (UTC)[reply]
I have not handled 1000+ pages like Gonnym has, but I get the sense that the previous version(s) of the template weren't really dealing with the parameters, it just looked like it did. But many people don't bother to see what microformat metadata is emitted, and many of these date-related templates claim to emit correct metadata, but don't do so consistently, and don't issue an error message when they can't emit correct metadata. Jc3s5h (talk) 21:00, 17 March 2025 (UTC)[reply]