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)
Thanks. I should have been more clear. I would like to input 3-16-2019 into a single template to produce Sat., 16 Mar 2019 or the equivalent. NewsAndEventsGuy (talk) 18:54, 16 March 2019 (UTC)
There may be a way to decode 3-16-2019 using this template but I hope not because that format is ambiguous (although the values make it obvious in this case that it is month-day-year). Something like 4-1-2019 could be April 1 or 4 January 2019. Using {{extract}} it is possible to decode unambiguous dates:
{{extract|2019-3-16|show=%a., %-d %b %Y}} → Sat., 16 Mar 2019
Thanks and I apologize for still not being clear. If I type 3|16|2019 in any order..... Or if I type those numeric digits with some other dilineation...... is there a single SIMPLE template that will output a date in any format that includes the day of the week?NewsAndEventsGuy (talk) 00:12, 17 March 2019 (UTC)
As well as {{extract}}, you could also try using the #time parser function, although I wouldn't call it simple. Maybe taking a different tack would be best here - where are you thinking of using this date-converting function? If we know a little bit more about what you want to use it for we might be able to give you some better options. Best — Mr. Stradivarius♪ talk ♪09:45, 17 March 2019 (UTC)
Thanks to all for help here. Whether it is needed is a matter of ongoing discussion at School strike for climate. My personal opinion remains conflicted.
This paragraph is an offtopic sidebar that I offer just to briefly explain the substance of the dispute, to give context. No need to reply to any of this here, though if you have thoughts to share it would be great to read those in the thread at talk page for the article. The location is School strike for climate. In defining the article scope the lead specifically says the events involve kids skipping school to protest for climate action. The key things is "skipping school". On article talk an IP observed that some of the events may have been held after school hours or on days when school was not in session. So the question is whether such individual events qualify for inclusion in the table. If this tool existed, it could help assess the scope of this dilemma. I could copy paste the entire table to a word processor and reformat the data in the date date column with a search and replace macro then copy back to the article. What we DO with the result is a matter for continued editing/discussion.
Returning now to topical question about the tools, in order to be really useful it would have to be super simple for a wide range of international nonNative English speakers to use. Thanks to all for your help. Again, if you have comments on the substance of the dilemma please add them at article talk. And thanks!
Can the subpages be deleted now that a module is being used?
It appears that most or all of the subpages of this template are no longer used, now that it has been converted to a module. Here's a list of the subpages:
Can we nominate these subpages for deletion? Is there any reason to preserve them for historical reference? I'll check each one for incoming links and transclusions before nominating, unless someone here wants to take on the TFD work. – Jonesey95 (talk) 20:33, 26 February 2019 (UTC)
No objections whatsoever from me. I'll go ahead and blank the sandbox page—I've long since forgotten about whatever I was trying to do there. —Salton Finneger (talk) 16:40, 19 March 2019 (UTC)
MM/DD/YYYY?
Has this template rejected attempts to use the MM/DD/YYYY format?, It outputs a format like that in DD/MM/YYYY.
Support for the text "present" to be treated as current date
Could the template be coded to add support for the word "present" so that it will treat it as the current date when sorting and will also display that text? To give it context: a table for television programs that have a column for when it debuted and when it ended. For programs that are still running, instead of leaving the column empty, I'd like to be able to write "present". This is similar to how the documentation at {{Infobox television season}} says to use dates with {{End date}} (though I don't see where exactly that template supports that). --Gonnym (talk) 14:24, 3 May 2019 (UTC)
ymd
Can we get an option for format=ymd? In timeline tables, it's the year that's the most important, plus it's ISO, so it would be nice to have it as an option. — kwami (talk) 22:24, 27 May 2019 (UTC)
Requested move 1 June 2019
The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review after discussing it on the closer's talk page. No further edits should be made to this section.
Moved. See general agreement below (perhaps a bit rough) to expand the template and module names. Please be patient as I will run some tests before I move the module page. If those tests run smoothly, then help from an admin will be needed to move the fully-protected template page. Kudos to editors for your input, and Happy Publishing! (nac by page mover) Paine Ellsworth, ed.put'r there13:36, 10 July 2019 (UTC)
It was proposed in this section that multiple pages be renamed and moved.
The discussion has been closed, and the result will be found in the closer's comment.
Support - having clear names makes both understanding what the template is, and finding such templates easier for editors unfamiliar with said templates. Also WP:TPN. --Gonnym (talk) 12:38, 1 June 2019 (UTC)
Strictly speaking, it is the module, not the template, that is the problem. I was not aware that modules could not be redirected. I have moved it back for now, and created a duplicate at the original move target until all the links can be changed over. bd2412T03:59, 24 June 2019 (UTC)
(ec) I don't know about modules vs. whatever else (i have created/modified templates but I don't even know what a module is) so take this comment as not fully informed. But there may be widespread other problems caused by the move. Actually, since the DTS template is transcluded so widely, I don't think the above discussion was adequate, so could the move discussion close be cancelled and the discussion reopened? With notice given to Village Pump and WikiProject NRHP and perhaps numerous other forums. One issue that usually/often doesn't matter is that one name uses less keystrokes than another, but here to expand to a longer name causes a significant increase in data storage/usage and perhaps reading times. Also implementation details were not adequately considered, apparently. This is too big of a change I think to be decided by just a few. --Doncram (talk) 04:03, 24 June 2019 (UTC)
Maybe it does not cause a performance issue for the servers, but I think it does cause a performance issue for the editors writing out tables, who have to contend with longer rows, sections, pages, harder to edit, not intuitive, when a short code is what they want for the purpose.
I do agree it would be unfortunate to have to involve in the many NRHP wikiproject editors who certainly don't want to be bothered. But if implementation requires widespread changes by bot or otherwise, they and other wikiprojects who use tables probably do need to be given notice. By giving notice to the village pump, i meant to the Village pump technical section where persons who might better know about likely impacts could be recruited to help implement something here, if it were important to implement something here (which it is not... I don't see why this is being discussed at all... i see no benefit to the project of imposing a change here, and there is cost already, i.e. the cost of the attention required by this discussion already). --Doncram (talk) 18:38, 24 June 2019 (UTC)
There was only massive cost because the original requested move was implemented in a technically inept way that broke the template. It may be that you see no benefit from templates not having needlessly abbreviated names, but the fact that this requested move had threeotherusers support it clearly indicates that many Wikipedians have the opposite opinion and do see a benefit to templates having non-abbreviated names. I had no reason to suspect that any of this breakage would happen when I started a requested move a few weeks ago, and thus no reason to post to VPT (although nothing is stopping you or anyone else from doing so). Furthermore, there will be no bots that go through all transclusions and change "Dts" to "Date table sorting"-- that task would be in violation of WP:COSMETICBOT. * Pppery *it has begun...18:53, 24 June 2019 (UTC)
I have to disagree. It turns out that implementing this move would require the editing of tens of thousands, perhaps hundreds of thousands of articles. Therefore, it should not be implemented until there is a clear consensus for such a change, and a strategy in place to implement this both technically and in terms of workflow. This can probably be done by a bot, but it does invoke larger interests. bd2412T04:12, 24 June 2019 (UTC)
When I moved the template, that did leave redirects behind, but it did not prevent the widespread template breakage. Do you mean that the fixes can be implemented without needing to edit anything other than those three pages? bd2412T04:22, 24 June 2019 (UTC)
Yes, I am aware of that. Now that we have had this discussion it will be easier for a closing admin to implement once the relisting period has elapsed. bd2412T04:30, 24 June 2019 (UTC)
Oppose - contrary to what is claimed above, renaming the template and module and then changing the text to point to the updated module name did still result in broken links. I have no idea for what reason, but when I went to 27 Club I found a whole table full of ugly red errors messages instead of dates. This is turning into a massive drain on editor time, and is pointless tinkering, so I am opposing it. But if an admin does close as moved, please at least make sure nothing is broken when you've done so. As BD2412 says, this will probably require setting up a bot to manually change all the links to the template across the wiki. THanks — Amakuru (talk) 15:23, 24 June 2019 (UTC)
Seems a bit out of place to revert the consensus attained move and re-open a closed RM. If you saw an error, you should report it so it can be investigated. --Gonnym (talk) 15:37, 24 June 2019 (UTC)
Well since the move had broken thousands of pages, I think it was quite justified myself. Try to consider the readers next time, Gonnym, instead of launching attacks on me. If someone wants to close this they can, but it needs much more consideration than has been shown so far. For now it is relisted, as was done by BD2412 this morning. — Amakuru (talk) 16:04, 24 June 2019 (UTC)
@Pppery: yep, as I said above I have no idea what is wrong with it. Just that whatever was attempted was not done correctly! Cheers — Amakuru (talk) 17:12, 24 June 2019 (UTC)
Not sure how my comment can be considered "launching [of] attacks on [you]", but I still stand by them. If you'd have reported the issues, someone (me included) could have looked at the issue and see what the issue is. As it stands I have no idea what red errors you saw, as when I try that page with the /sandbox version I don't get those red errors. From a very basic look and without any error to work on, it would seem that the issue might be related to the fact that the module has a specific template set up as the wrapper. --Gonnym (talk) 18:44, 24 June 2019 (UTC)
Oppose. DTS is quite clear: it is a quick device to make a date sortable and is good as an acronym or code that is not meant to be spoken out literally. The term "date table sorting" is descriptive of the overall issue; one could create a Wikipedia article date table sorting on the general topic, as applies in Wikimedia and in Excel / Lotus 1-2-3, other table systems current and historical. The term "date table sorting" does not naturally apply to the formatting of a given datum. What is needed is a code.
The requested move seems like "needless tinkering" as someone suggested above. It would be like trying to force the world to change from Qwertyuiop keyboards to something more "sensible", which would cause needless disruption. Everyone who uses the template knows what it is; the quest to change it (in order to make it more understandable/clear?) only imposes needless burden on everyone. Or maybe this would be like a quest to replace use of the code "." by the word "period" to make it more understandable? Bad idea period. We all know what the code is, and a code is what is needed, and the expanded term is not even descriptive to the individual usages.
Anyhow I have used template:DTS in the past and was happy enough with it. When editing a page, I would NOT want to write out "date table sorting" a zillion times or to have it written out longer automatically; it literally makes it more difficult to see all of then-longer longer row or section or page. --Doncram (talk) 18:38, 24 June 2019 (UTC)
Comment The documentation at Template:Dts/doc and perhaps elsewhere linked to there is now screwed up too, showing mixed usage of "dts" and "date table sorting". Some others have tried, and I have tried, to restore previous documentation appearance, but maybe there is more linked templates inside templates that need to be fixed to get it right again. --Doncram (talk) 18:38, 24 June 2019 (UTC)
Comment - DTBSRTorDTbSrt - No one suggested either of these. For those who think that all TLAs (3LtrAcronyms) *must* be limited to three letters, DTS wins. For those who accepted 4 letters TLAs at some point, then graduates of SIXbit (ancient pre-EBCDIC/8-bit ASCII) would find DTBSRT (pre-UpLo) or DTbSrt reasonable, especially since the 2nd T-byte represents both daTe and Tbl/Table. 'Nuff said.Pi314m (talk) 04:15, 25 June 2019 (UTC)
I echo Gonnym. @Amakuru: What exactly did the error on 27 Club say? And are you sure it was the kind of error that simply a purge wouldn't have eliminated? And even if so, reverting the moves per se may have been justified but it doesn't strike me as a reason to go so far as to reopen the RM—you could have simply reported it so others could identify the problem and carry on with the renaming—this is borderline wheel-warring.Nardog (talk) 18:09, 25 June 2019 (UTC)
The above discussion is preserved as an archive of a requested move. Please do not modify it. Subsequent comments should be made in a new section on this talk page or in a move review. No further edits should be made to this section.
Post move
To editor Amakuru: this is a technical request to rename {{Dts}} to {{Date table sorting}}. The module has been renamed and the template now calls the module with the expanded name. As seen at 27 Club#Identified members, there are no error codes tripped. As long as the Dts redirect is left behind, there should be no further problems. Thanks in advance for confirming and for renaming the template!Paine Ellsworth, ed.put'r there14:46, 10 July 2019 (UTC)
@Paine Ellsworth:@Pppery: OK, I've made the move, but 27 Club is now showing no dates at all in the birth/death columns. I purged its cache too. Have I done something wrong? I won't revert, so we can figure out what's going on, but we need someone who understands these things to sort it out — Amakuru (talk) 14:58, 10 July 2019 (UTC)
Ah It's working now. Must have just taken a while for something on the back end to catch up. All looks good then. Thanks. — Amakuru (talk) 15:08, 10 July 2019 (UTC)
Invalid dates
{{date table sorting|2018/02/29|format=dmy|abbr=off}} should output 1 March 2018 instead it outputs as 29 February 2018, is there anyway to correct February 29th as March 1st when the year is not a leap year?
Same goes with {{date table sorting|June 31, 1995}} should output July 1, 1995 instead it outputs as June 31, 1995, is there anyway to correct June 31st as July 1st? --98.31.29.4 (talk) 17:05, 4 August 2019 (UTC)
Please do not attempt to "autocorrect" invalid dates! The templates based on Module:Age (not this template) only accept dates in an unambiguous format, and always display an error with a tracking category when a date is invalid. That catches a surprisingly large amount of mucking around with dates which need to be reverted, not autocorrected to invalid data. This template handles fantastically large dates for use in astronomical tables and similar, whereas the Module:Age templates only handle from 9999 BCE to 9999 CE. Johnuniq (talk) 22:47, 4 August 2019 (UTC)
Template-protected edit request on 8 December 2019
The explanation for the wrapping parameter is unclear. Does this template output non-breaking spaces by default, and this parameter change to normal spaces, or is it about allowing the name of a month to break across two lines? Presumably it’s default isn’t “off” as stated. Jim Craigie (talk) 04:23, 13 November 2020 (UTC)
table-wide parameter?
Since this template is intended for use in making table columns sortable, it would be nice if it were possible to set a parameter at the level of the whole table so that options such as |format=dmy, which is required to avoid US-centric dates, do not have to be repeated for each individual date entry? I have no idea if this sort of scope would work in this html/mediawiki mix. Boud (talk) 23:51, 29 February 2020 (UTC)
In the preview of an edit I see Vorlage:Date table sorting instead of the date. the date is formatted as | 5,91<ref name="HVZ-BW" /> || {{Date table sorting|1823|08}}. Is something additionally needed? Theking2 (talk) 20:14, 28 July 2022 (UTC) Theking2 (talk) 20:14, 28 July 2022 (UTC)
Since the standard linking and the optional link=off have been removed, couldn't we at least add an optional link=on for special cases? Thanks. Est. 2021 (talk·contribs) 02:25, 8 October 2022 (UTC)