Edge Rewrite
Jump to content

Template talk:Use dmy dates

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 1 month ago by Jonesey95 in topic cn tags?

Is a mdy and dmy conflict handled?

[edit]

While I will admit to having too many things on my mind right now, it certainly appears that one can add both {{use mdy dates}} and {{use dmy dates}} to the same article. Is this handled? It should be. Fred Gandt · talk · contribs 16:55, 15 September 2025 (UTC)Reply

As far as cs1|2 is concerned, Module:Citation/CS1/Configuration has a list of patterns derived from the template canonical names ({{Use dmy dates}}, {{Use mdy dates}}) and associated redirects ({{Use MDY dates}}, {{Use DMY dates}}, {{mdy}}, {{Use dmy}}, {{Use mdy}}, etc). The list is ordered by frequency of use at the time that the list was compiled. {{Use dmy dates}} was by far the most commonly used template name (1159k transclusions) with {{Use mdy dates}} a distant second (212k transclusions). cs1|2 searches the article wikitext for each template canonical name/redirect starting at the top of the list and working down. cs1|2 stops searching once a {{use xxx dates}} template or recognized redirect is found so an article with both {{use dmy dates}} and {{use mdy dates}} will cause cs1|2 to render dates in dmy format. Today the two canonical name transclusion counts have moved somewhat closer: 1902k vs 1010k.
I do not know how the various scripts that tweak date formats handle a conflict. Perhaps Editor Ohconfucius will answer that part of your question.
Trappist the monk (talk) 17:35, 15 September 2025 (UTC)Reply
Regardless of how the software handles it, I think having both templates on a single article is simply a mistake that should be corrected. —David Eppstein (talk) 18:14, 15 September 2025 (UTC)Reply
According to this simple search, there are fewer than ten such articles.
Trappist the monk (talk) 19:35, 15 September 2025 (UTC)Reply
Also the corresponding conflict for English variant - see this edit, including the two lines that follow the removed line. --Redrose64 🌹 (talk) 20:20, 15 September 2025 (UTC)Reply
Indeed. See some search links at this Template:EngvarB discussion. Maybe a report could be designed to dig up duplications like these. – Jonesey95 (talk) 20:31, 15 September 2025 (UTC)Reply
There's nothing that I know of that handles them automatically and in my experience I think it's probably better that we don't. There used to be hundreds of them until some mystery contributor and myself got the numbers down. It now usually hovers around 7 articles. They're usually the result of information being merged in a suboptimal way, someone slapping the other tag on an article in an OWN manner or a bot that's not as clever as its owner wants it to be. They usually need a number of things fixing besides the date template. I use this custom search to find articles that contain both templates. Not sure if that catches redirects and alternative names though. - X201 (talk) 20:41, 15 September 2025 (UTC)Reply
@Trappist the monk: simply establishing correct format from the first declaration found is certainly very convenient. When I looked into how {{short description}}s were handled while building Module:GetShortDescription, it became quite the palaver to build a test suite and algorithm for all the bizarre possible edge cases. The fact that these date format preferences do almost nothing but categorize the page is a bonus, but establishing which of multiple is actually correct would require manual review and intervention (without an unreasonable effort to programmatically analyze the history). My comment now, of course, is coming after a lot of activity to create database reports and the like, but it's worth considering that all of this guesswork and manual review can be avoided by a more robust set of mechanisms built in. I really think each date format (and engvar to boot) template should check if it's being placed on a page with an already present fellow, and do something proactive about it. Fred Gandt · talk · contribs 20:22, 16 September 2025 (UTC)Reply
It is sometimes easier to fix problems after they occur, especially if they occur rarely, than to complexify a simple, widely used bit of code. The above conflict is currently present in just six articles out of six million or so. – Jonesey95 (talk) 20:44, 16 September 2025 (UTC)Reply
I guess that I concur with Editor Jonesey95. If we do, someday, decide to do summat about conflicting templates, we should probably merge the functionality into a single template with named parameters; perhaps summat like this:
{{article config |dates=dmy |engvar=british}}
Trappist the monk (talk) 21:49, 16 September 2025 (UTC)Reply
A wise suggestion Trappist. I appreciate the argument Jonesey, but with caching and other optimizations, the minimal additional work required to show a preview warning and possible other measures (so many options) on page save would have little meaning. It's fine if we never agree; I'm a "fix it before it breaks" type, but have no intention of pushing :)
Assuming the "fix it after it breaks" approach is the rut we drive in for a while, perhaps a bot can be employed to deal with these things (in the event that humans are unavailable, clueless or unwilling). I think it'd be trivial for a bot to figure out which came first, but not necessarily which should be used, so to ensure the issue does get some attention, perhaps visibly tagging the article as having conflicted formatting instructions that may result in undesirable display and categorization, so any passer by might do the necessary review and cleanup? Fred Gandt · talk · contribs 22:36, 16 September 2025 (UTC)Reply
Yeah, "which came first" isn't necessarily right. I made this edit while glancing over the results from the engvar conflicts report, and an identical one to a similarly-named article; the date given in the use-indian-english template was two years before the article was created, and actually placed four years before the use-new-zealand-english template, but NZ was the correct one to retain per MOS:TIES. These are going to need a human to look at, every one. And for all I know, it might even be correct for some of these articles to keep two engvar templates indefinitely. —Cryptic 00:33, 17 September 2025 (UTC)Reply
Indeed. I recently added {{Use American English}} per MOS:RETAIN (since there are no strong ties) and {{Use mdy dates}} per MOS:DATERET to Pigeon racing. I had to walk through the history one diff at a time looking for first instances of distinct engvar and date formats. The article was started in May 2003, and the engvar established quite early in July 2005, so that wasn't too bad, but the first full date to establish format didn't come until October 2013. I made notes of the Special:Diffs <!--alongside the templates--> so no one ever has to go through that labour again. I'd love to see simple toggles built into the UI, active for users with required perms, to dial these things in as a content setting, but that's a conversation for another place and time I think.
In cases where archived and/or remote discussions have resulted in changes to the usages, or where multiple variants have been established as acceptable (I suspect that may be the case for the Rupert Murdoch article), getting to the bottom of it without a familiarity with that history would be a job of work, and a bot wouldn't stand a chance of figuring it out (efficiently and reliably). This again is why I made notes about how the usages were established – something that could be valuable as a param in these templates, perhaps to a permalink or diff. Fred Gandt · talk · contribs 01:57, 17 September 2025 (UTC)Reply
Template:Use does exactly that. But I don't see how it'll help fix or prevent conflicts - you could still have {{use|dmy|gb|date=January 2001}} at the top of the article and {{use|mdy|us|date=January 2000}} at the bottom next to the categories anyway, like we currently see with {{use mdy dates}} and {{use dmy dates}}. (And significantly more widely with the engvar templates than the date ones - there's about 300 articles affected with those.) —Cryptic 00:28, 17 September 2025 (UTC)Reply
I think (correct me if I am wrong Trappist) that the combination's value in this case would be if the template ran code to check its situation and act accordingly. It's not that combining them would solve the conflict, but that code built in to help in resolving it, would only have to run and be maintained in that one template/module. Fred Gandt · talk · contribs 01:57, 17 September 2025 (UTC)Reply

New database report

[edit]

Cryptic has helped me create a database report that lists article-space conflicts between "Use" templates. Wikipedia:Database reports/Multiple "Use" templates is in a rudimentary state right now. Someone well-versed in SQL could probably figure out how to write a query that finds "any two of the following list of templates: Use XX English, Use YY English, Use ZZ English, etc." (It may be easier to look for pages that are in two or more subcategories of Category:Wikipedia articles written in a national variety of English.) The report currently refreshes daily and can be refreshed manually. – Jonesey95 (talk) 22:52, 15 September 2025 (UTC)Reply

Working on that already. It's going to need a different approach than just that pairwise comparison - two or more of three templates would be feasible, but two or more of 22 isn't. And, yes, since they're all direct subcats of Category:Wikipedia articles written in a national variety of English, and don't have any subcats of their own, going by category will be much easier. —Cryptic 22:55, 15 September 2025 (UTC)Reply
quarry:query/97200. —Cryptic 23:17, 15 September 2025 (UTC)Reply
(Also, if you keep on adding pairs of templates to that query, at some point it's probably going to abruptly tip over from needing another 10 to 20 seconds per additional pair to multiple hours. Bring it back to RAQ if/when that happens. —Cryptic 22:56, 15 September 2025 (UTC))Reply
Very nice! There are now two reports:
Thanks to Cryptic for these helpful queries. – Jonesey95 (talk) 00:43, 16 September 2025 (UTC)Reply

Well, that escalated quickly. I think it's fair to say you all have it handled. Good job team ;) Fred Gandt · talk · contribs 00:49, 16 September 2025 (UTC)Reply

Inconsistent regional spellings

[edit]

This template documentation is using inconsistent British and American spellings. 2604:3D08:9476:BE00:34C1:DC92:C15D:3454 (talk) 02:39, 1 October 2025 (UTC)Reply

We have a section in the "Manual of Style" which says articles should use a consistent variety of English. But the "Manual of Style" only applies to articles, not template documentation. Jc3s5h (talk) 03:12, 1 October 2025 (UTC)Reply
Yeah… but I feel like this template documentation should too. 2604:3D08:9476:BE00:34C1:DC92:C15D:3454 (talk) 04:58, 1 October 2025 (UTC)Reply
Non-article space items are not required to meet the standards of articles. - X201 (talk) 07:36, 1 October 2025 (UTC)Reply
Can you point out any particular instances of inconsistency? Strictly speaking, we don't have to fix them but if it is just a few small changes then we may as well fix them.  Stepho  talk  11:02, 1 October 2025 (UTC)Reply
I found "flavour" and "recognized", FWIW. I have no opinion on whether they should be changed, except that "flavour" should probably be changed to "format" to be more accurate and encyclopedic. I have made that change. – Jonesey95 (talk) 11:19, 1 October 2025 (UTC)Reply

Does this template imply "1 January" for dates without years?

[edit]

I can totally get behind "1 January 2025" for full d/m/y dates, but I'm seeing editors change plain "January 1" into "1 January" as well. Is this really the intention? It does not sound natural in English. Asamboi (talk) 08:56, 19 November 2025 (UTC)Reply

Yes. Every country that uses d/m/y also uses d/m when the year is left out. Never, never, never, never, never, never, never, never, never mix 1 January 2025 with January 1 in the same article unless it is a direct quote.  Stepho  talk  10:04, 19 November 2025 (UTC)Reply
It does “sound natural” to anyone who isn't a citizen of the USA. It is pronounced as “the first of January”; “January, the first” is merely an incomplete sentence. Tag me if you are responding to my content or wish to notify me, because I may not be subscribed. (talk) 18:12, 17 December 2025 (UTC)Reply

Is there any way to limit this template to the article itself, but keep ymd for the reference list?

[edit]

Honestly, I find myself removing this from articles that I edit, as I prefer all digit ymd for a bibliographic list (which I believe is preferred by WP:MOS), and this template seems to force dmy universally in both article text and citations. I'd love to know if there's a workaround. Peter G Werner (talk) 20:35, 9 June 2026 (UTC)Reply

I believe it is allowed by the MOS. I don't think there is any sense in which it is or should be preferred. —David Eppstein (talk) 21:01, 9 June 2026 (UTC)Reply
Some editors hate it (see David's comment above) and some editors love it (me). Either way is just a preference and MOS leaves it up the article's early editor to choose. Try {{use dmy dates |cs1-dates=y |date=June 2026}} (and the equivalent for mdy). See all options at {{use dmy dates}}. But note also that a late editor should not change from one format to the another without consensus - see WP:DATERET. If the references have been dmy or mdy for a long time then do not change them to ymd. If they have been ymd for a long time then do not change them to dmy or mdy. If somebody changed this recently by adding the template then you should restore it by adding {{{cs1-dates|y}}}. If it's just your preference then leave it alone.  Stepho  talk  21:51, 9 June 2026 (UTC)Reply
Yeah, looking at MOS, I see there isn't a preference. I had thought Wikipedia favored something close to typical academic "Harvard" style in formatting style. In any event, the "cs1-date=y" makes it work the way I want it to, so thanks! Peter G Werner (talk) 00:46, 10 June 2026 (UTC)Reply
Your edit at Paul Schäfer is against WP:DATERET. Looking through the article history, until this month the references were dmy. You changed the references to ymd. While your preferred style matches my own preferred style, this is how edit wars start by different editors each trying to enforce their own preference - see WP:EDITWAR. Simply put, it is "first one wins". The article had dmy references for many years, so it should remain that way unless you can get consensus on the talk page to change it.  Stepho  talk  01:17, 10 June 2026 (UTC)Reply

cn tags?

[edit]

I was surprised to see citation needed tags in the syntax section? They were here from creation. Ping Rich Farmbrough, I know it was a long time ago, can you recall? Valereee (talk) 14:39, 17 June 2026 (UTC)Reply

For the record, the {{cn}} tags were added to Template:Use dmy dates/doc at this edit. The notes regarding 'performance' were added to the ~/doc page at this edit by Editor Matthiaspaul.
Trappist the monk (talk) 15:17, 17 June 2026 (UTC)Reply
Yes, there's a tendency to think that things impact performance significantly, when thy don't, or don't very much, or sometimes shouldn't. I like to see at least reference to some measurements for these types of claims.
Secondly it's not clear that we should worry about performance as editors. WP:PERF All the best: Rich Farmbrough 07:17, 18 June 2026 (UTC).Reply
I have boldly removed these statements about performance. They seem unlikely to be true. – Jonesey95 (talk) 14:15, 18 June 2026 (UTC)Reply