This is an archive of past discussions about Template:Date table sorting. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page.
However, the ranges (which are recommended by MOS:DOB as perfectly fine), are being rejected by the Dts template en masse. Please fix this if you know how, in order to make the Dts template compatible with our Manual of Style. Thank you. Poeticbenttalk15:02, 16 February 2018 (UTC)
It says that they are acceptable for use in articles, but DTS isn't capable of using them in sorts. It would make the logic of figuring out the year, month and day for the purposes of generating a sort string much more difficult. Basically what dts does is takes a variety of formats and figure out the year, month and day from them and uses that to build a long invisible number which allows for consistent sorting. So for example, you can have "2002-02-27" and "26 Jun 1988" in the same list and it will make it so that the second will properly sort before the first. Template:Dts/doc shows all the formats that it does handle. The additional logic to properly handle "January 4-5, 1998", "January 4-February 1, 1998", "4-12 January 1998" "4 January - 1 February 1998" (all of which should sort to the same value" and others would be a significant expansion of the code. Given its use in over 20,000 pages, I think it would take a *lot* of testing as well before release.Naraht (talk) 19:31, 16 February 2018 (UTC)
Additionally, the question become whether every other form should be handled by DTS including circa, after and before...Naraht (talk) 19:33, 16 February 2018 (UTC)
Thanks for letting me know about the the DTS handling capabilities, Naraht. Needless to say, the difficulties which you described above do not change the fact that the DTS template – as it stands – is not compatible with the MOS:DOB policy, and the policy does not even inform about that incompatibility, making people like me wonder whether the fault in formatting was ours alone, and thus only wasting time trying to correct ourselves, before giving up on it. Poeticbenttalk20:20, 16 February 2018 (UTC)
{{dts}} works with a single date. Why would you expect it to handle a range of dates? If there are several articles that need such a feature it might be reasonable to make a new template for that specific purpose. I like simple names and Template:dts2 might be good. I see that page was deleted per TfD. It would not be straightforward because the examples here are like "January 4–5" but could be much trickier, such as "1 Feb 2011 to 5 March 2015". Johnuniq (talk) 23:01, 16 February 2018 (UTC)
The "code" for dts is at Module:Dts. If anyone has suggestions on upgrading it to handle date ranges, so that it sorts on the first day in the range, I'd love to take a look. It appears that the primary editor (though no edits since 2015) for the template is Mr. Stradivarius, but as I indicated, the testing would be significant.Naraht (talk) 01:01, 17 February 2018 (UTC)
Please start by linking to a couple of articles where this would be useful. Then produce a comprehensive set of examples that should work. Above we see "4–5 Jan" and "January 4–5". Should hyphens instead of en dashes be accepted? What about "to"? What other forms of input should be accepted? There is no need for an elaborate table—just a simple list showing the date range only. Johnuniq (talk) 08:04, 17 February 2018 (UTC)
Hi all. The traditional way to make this kind of thing work is to use {{dts|1945|11|22|hide=yes}}November 22–23{{dts|1945|11|22|format=hide}}November 22–23. The template part of that produces the hidden sort code only, which makes it sort correctly, and then the only part you see is the text outside of the template invocation.
While this words, it is a little inelegant. I was thinking that it might be neater to change the module to allow a |display= parameter, so that you could do something like {{dts|1945|11|22|display=November 22–23}} instead. Does that sound like a reasonable suggestion? — Mr. Stradivarius♪ talk ♪11:05, 19 February 2018 (UTC)
I think that the original discussion got off track with how to interpret complex examples, and I think that simply having it not do so is probably the right answer. I've used the hidden trick myself for including things like Fall and Spring in fraternity founding listings. I support the addition of a display parameter with the idea that whatever is in display is the entire display. (Having said that, I think the example article should be changed so that the year is part of the same column). I think that the hide parameter should be kept, simply because trying to change everything that uses hide to instead use display seems like a monster task even for a bot, but I think that can be kicked down the road slightly. — Preceding unsigned comment added by Naraht (talk • contribs) 14:39, 19 February 2018 (UTC)
I definitely support change of the module to allow a |display= parameter. The example of "{{dts|1945|11|22|hide=yes}}November 22–23" looks like someone is just trying too hard to do, what's impossible. The actual year column has nothing to do with it. Please, do it, if you know how. Thanks, Poeticbenttalk15:07, 19 February 2018 (UTC)
Poeticbent Since the dates in question for that article range over 1944, 1945 and 1946, once a clear way to change the Month/day column is worked out, I think it does make sense to combine (especially since a sort which simply sorts by year will not be useful), but I'll start that discussion on the article talk page *after* the display parameter is available. — Preceding unsigned comment added by Naraht (talk • contribs) 17:01, 19 February 2018 (UTC)
Please try again. We are almost there. {{dts|1945|05|27|display=May 27–28}} does not stop at the month and just one single day in display, but also, automatically adds the year to it, which looks like this: May 27, 1945 (no range given). Also, could you add |hide=yes as a valid alternative to |format=hide. Thanks, Poeticbenttalk17:35, 19 February 2018 (UTC)
@Poeticbent: The main template isn't updated yet, just the sandbox, so for now you need to use {{dts/sandbox|1945|05|27|display=May 27–28}}. As for |hide=yes, I'm not so sure - I think it complicates the code for no real benefit. — Mr. Stradivarius♪ talk ♪22:55, 19 February 2018 (UTC)