Template talk:Date table sorting: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) to Template talk:Date table sorting/Archive 2) (bot
 
(345 intermediate revisions by 99 users not shown)
Line 1:
{{talkheader|search=yes}}
This is the discussion/talk page for: [[Template:Dts]].
{{User:MiszaBot/config
__TOC__
|archiveheader = {{talkarchivenav}}
=<font size=3>Topics from 2007-2008</font>=
|maxarchivesize = 75K
== Expand the features ==
|counter = 2
This template has no error checking for missing params, like day or month, and it should, since date can sort without them. It broke our [[Help:Sorting#Dates]] section, too! To convert existing tables in the DD-MM-YYYY format to something pretty, and to do it easily, it needs to be able to take the standard DD-MM-YYYY or DD-MM-YY format. In those cases, there would be no need to error check. Maybe it could just check parameter {{{1}}}, perhaps, for dashes and then directly print the full string hidden, then wikilinked, and Mediawiki will do the rest. Let me know if that part doesn't make sense. Sorry I can't figure out how to do that myself.—[[User:Wikibarista|Wikibarista]] 17:16, 21 March 2007 (UTC)
|minthreadsleft = 3
|minthreadstoarchive = 1
|algo = old(14d)
|archive = Template talk:Date table sorting/Archive %(counter)d
}}
 
== [[:ce:Модуль:Dts]] ==
== Being used outside of sorted tables ==
 
Hello! Can someone help me fix the date format in Chechen? should be "2020 шеран 9 декабрь". [[User:Takhirgeran Umar|Takhirgeran Umar]] ([[User talk:Takhirgeran Umar|talk]]) 20:28, 9 December 2022 (UTC)
The acronym is great, but unfortunately, it's being [http://en.wikipedia.org/w/index.php?title=Jissen_Pachi-Slot_Pachinko_Hissh%C3%B4h%C3%B4_%21_Hokuto_no_Ken&diff=prev&oldid=116744504 used incorrectly] already by people to just put in dates anywhere in an article. We should rename it to "sortdate" to avoid misuse, because the misuse will cause pages to be larger when they're converted to HTML. —[[User:Wikibarista|Wikibarista]] 18:02, 21 March 2007 (UTC)
 
== How to make date ranges sort to correct position in both ascending and descending displays? ==
==[[Template talk:Sort]]==
Centralized discussion for all issues surrounding sortkeys for wikitables created here: [[Template talk:Sort]]. ~ [[User:Trialsanderrors|trialsanderrors]] 09:02, 5 April 2007 (UTC)
 
Is there any way to make a [[MOS:DATERANGE]] sort to the correct chronological position in both ascending and descending displays? For example in [[Jack Deam#Filmography]] the date ranges sort by the first date in the range, which is correct if sorting oldest first but gives incorrect chronological order when using date sorting to display most recent at the top where it is the end of the range date that determines correct chronological order. [[Special:Contributions/213.18.145.207|213.18.145.207]] ([[User talk:213.18.145.207|talk]]) 13:44, 5 April 2023 (UTC)
==Possible bugs==
:I believe not although you might check at [[WP:VPT]]. As I far as I know, each column has a single sort key which is used for both ascending and descending ordering. For example, <code>2016–2022</code> cannot be sorted by 2016 in one direction and 2022 in the other. I don't think it matters much for the example given. If it were a big deal, two columns would be needed, one for the first date and another for the last. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 02:53, 6 April 2023 (UTC)
My [[Special:Preferences]] have the date presentation set to "2001-01-15T16:12:34". Yet when template is passed '''<code><nowiki>{{Dts|15|January|2001}}</nowiki></code>''' I get the output of "15 January 2001". Surely I should be seeing the same output as what '''<code><nowiki>[[January 15]] [[2001]]</nowiki></code>''' would give me, which is "2001-01-15". What's gone wrong? --[[User:Oscarthecat|Oscarthecat]] 16:46, 10 April 2007 (UTC)
 
== Invalid date error for 2524 BC ==
:I fixed it, it was due to a blank space in the year link: <nowiki>[[12 April]] [[2007 ]]</nowiki> gives [[12 April]] [[2007 ]].--[[User:Patrick|Patrick]] 07:25, 12 April 2007 (UTC)
::Thanks for the quick response Patrick. Yes, now working great. --[[User:Oscarthecat|Oscarthecat]] 20:32, 15 April 2007 (UTC)
 
The [[Decolonisation of Asia]] article has a table with a cell containing the date 2524 BC. This template throws an error if used with this date. [[User:Wtmitchell|Wtmitchell]] [[User talk:Wtmitchell|(talk)]] <small>(earlier ''Boracay Bill'')</small> 00:16, 4 January 2024 (UTC)
Great work this weekend! I noted dts doesn't play nice with {{tl|sortdate}} in the same table. I ''might'' be wrong on that, I'll have to look later. —[[User:Wikibarista|Wikibarista]] 00:28, 17 April 2007 (UTC)
:I believe the following works:
:A-ha, I see it. dts has a leading 0 whereas sortdate does not. —[[User:Wikibarista|Wikibarista]] 00:35, 17 April 2007 (UTC)
:*<code><nowiki>{{dts|2524|||BC}}</nowiki></code> → {{dts|2524|||BC}}
 
:The missing parameters 2 and 3 are for the month and day. The era (BC etc.) is parameter 4. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 00:38, 4 January 2024 (UTC)
::I have added the zero in sortdate.--[[User:Patrick|Patrick]] 08:54, 3 May 2007 (UTC)
:{{ping|Wtmitchell}} I should probably have notified you. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 03:37, 4 January 2024 (UTC)
 
::Thanks. I applied fixed [https://en.wikipedia.org/w/index.php?title=Decolonisation_of_Asia&diff=1193505885&oldid=1192949085 here]. [[User:Wtmitchell|Wtmitchell]] [[User talk:Wtmitchell|(talk)]] <small>(earlier ''Boracay Bill'')</small> 04:39, 4 January 2024 (UTC)
==[[List of Wii games]]==
It seems like this template is breaking the sortable list of wii games, around the game "Wii Play". I have been unable to solve the problem, is any template coder capable of providing advanced help around? --[[User:Krator]] ([[User talk:Krator|t]] [[Special:Contributions/Krator|c]]) 14:43, 26 April 2007 (UTC)
:It seems the limit per [[Wikipedia:Template limits]] is reached on the page. --[[User:Krator]] ([[User talk:Krator|t]] [[Special:Contributions/Krator|c]]) 15:07, 26 April 2007 (UTC)
 
== Change entry format from MM-DD-YYYY to YYYY-MM-DD ==
 
I motion that we change the entry format for this template from MM-DD-YYYY to YYYY-MM-DD. Pretty much all of the templates that require date entry are using YYYY-MM-DD ( {{tl|Age in days}} is one I use often), and this should be changed to conform to that. I think that's standard - even the citation templates use that format. [[User:Gary King|Gary King]] ([[User talk:Gary King|talk]]) 02:36, 26 March 2008 (UTC)
 
==Compatibility with [[WP:DATE]]==
Based on recent changes to date formats (in particular, date autoformatting) in the [[Wikipedia:Manual of Style]] for dates, I would like to suggest that "link=off" should be the default setting so that dates are not automatically linked when not specifying a parameter (likely to be the most common usage). If editors wish to link dates, they can set "link=on". [[User:Truthanado|Truthanado]] ([[User talk:Truthanado|talk]]) 00:15, 15 September 2008 (UTC)
 
: A lot of people who use this template might then wonder why the links are now off; they might think something is broken, perhaps. <font face="Verdana">[[User:Gary King|<font color="#02e">Gary</font>&nbsp;<font color="#02b"><b>King</b></font>]]&nbsp;([[User talk:Gary King|<font color="#02e">talk</font>]])</font> 03:00, 15 September 2008 (UTC)
 
::That kind of confusion is already happening with the major change in the way dates are handled now. In the interest of moving forward to a consistent system, maybe that's an acceptable "bump in the road". [[User:Truthanado|Truthanado]] ([[User talk:Truthanado|talk]]) 11:32, 15 September 2008 (UTC)
 
::: I don't mind; I created that feature in this template and would like to see the default as unlinked. But of course, I'm always a fan of consensus, too :) <font face="Verdana">[[User:Gary King|<font color="#02e">Gary</font>&nbsp;<font color="#02b"><b>King</b></font>]]&nbsp;([[User talk:Gary King|<font color="#02e">talk</font>]])</font> 14:14, 15 September 2008 (UTC)
 
:::: I think if the policy is to have unlinked dates, then the template ought to be made to be consistent with that policy. It is true that some people might think the template is broken, but then that should hopefully lead them to discover the change in policy, which would be a good thing in the long run! [[User:Mrh30|Mrh30]] ([[User talk:Mrh30|talk]]) 09:27, 10 October 2008 (UTC)
 
You can set the default to be 'link=off' because all articles now use it for dts (and for the now deprecated dts2 template). The default will be useful for new uses. [[User:Lightmouse|Lightmouse]] ([[User talk:Lightmouse|talk]]) 13:30, 25 October 2008 (UTC)
: Done <font face="Verdana">[[User:Gary King|<font color="#02b">Gary&nbsp;<b>King</b></font>]]&nbsp;([[User talk:Gary King|<font color="#02e">talk</font>]])</font> 19:02, 25 October 2008 (UTC)
 
Thanks. [[User:Lightmouse|Lightmouse]] ([[User talk:Lightmouse|talk]]) 17:37, 26 October 2008 (UTC)
 
== Day and month without year? ==
 
I thought I had already asked this question, but apparently not. :) Is it possible to make this template display a date without the year, i.e. just day and month? [[User:PC78|PC78]] ([[User talk:PC78|talk]]) 23:16, 23 October 2008 (UTC)
: No, not with its current setup. <font face="Verdana">[[User:Gary King|<font color="#02b">Gary&nbsp;<b>King</b></font>]]&nbsp;([[User talk:Gary King|<font color="#02e">talk</font>]])</font> 23:20, 23 October 2008 (UTC)
::What I mean is, is it feasible to make this change to the template? [[User:PC78|PC78]] ([[User talk:PC78|talk]]) 00:42, 24 October 2008 (UTC)
::: This feature was not implemented probably because it wasn't requested that often. It can be done, though. In which article it is needed? <font face="Verdana">[[User:Gary King|<font color="#02b">Gary&nbsp;<b>King</b></font>]]&nbsp;([[User talk:Gary King|<font color="#02e">talk</font>]])</font> 04:27, 24 October 2008 (UTC)
::::I've been using it in articles such as [[List of South Korean films of 2006]], where repeating the years seems rather redundant and takes up space. [[User:PC78|PC78]] ([[User talk:PC78|talk]]) 13:39, 25 October 2008 (UTC)
::::: Okay done. <code><nowiki>{{dts||10|25}}</nowiki></code> will show as {{dts||10|25}}; it will be sorted along with other dates that ''do'' have years, and it's year will be considered as whatever the current year is (so in this case, it would be sorted as <code>2008-10-25</code>). <font face="Verdana">[[User:Gary King|<font color="#02b">Gary&nbsp;<b>King</b></font>]]&nbsp;([[User talk:Gary King|<font color="#02e">talk</font>]])</font> 21:19, 25 October 2008 (UTC)
::::::Many thanks! [[User:PC78|PC78]] ([[User talk:PC78|talk]]) 13:21, 26 October 2008 (UTC)
 
=<font size=3>Topics from 2009-2010</font>=
== Approximate dates ==
 
Is it possible to use this table with approximate dates? I'm thinking of dates in the format "c.", "before", "after", "16/17 November" etc. The question relates to [[List of the titled nobility of England and Ireland 1300–1309]] which is currently nominated for FL, where it has been suggested that a sortable list be used. I've found this problematic with so many approximate dates. [[User:Lampman|Lampman]] ([[User talk:Lampman|talk]]) 13:24, 21 February 2009 (UTC)
: That's not possible with the current code. Regarding implementing it, I think it'd be easier to write custom code for the specific article rather than rewriting this template. Just use {{tl|sort}} to do what you want; the first parameter is for sorting, the second is for what you actually want to appear. <font face="Verdana">[[User:Gary King|<font color="#02b">Gary&nbsp;<b>King</b></font>]]&nbsp;([[User talk:Gary King|<font color="#02e">talk</font>]])</font> 16:24, 21 February 2009 (UTC)
 
==Retrofit talk-page year headers==
''19-Mar-2009:'' I have added subheaders above as "Topics from 2007-2008" (etc.) to emphasize the dates of topics in the talk-page. Older topics might still apply, but using the year headers helps to focus on more current issues as well. -[[User:Wikid77|Wikid77]] ([[User talk:Wikid77|talk]]) 12:38, 19 March 2009 (UTC)
 
==Template:Dts/ver for invalid dates==
''19-March-2009:'' I have created the temporary variation [[Template:Dts/ver]] to allow reporting invalid dates. That template could be merged at a later time, after options are fully developed.<br>
Naturally, sometimes people are putting day-number for the month, where 21 gives "September" (21-12=9), 23 gives "November" etc. As in other templates, I was expecting an error-page-category, such as "'''Category:Template dts invalid month pages'''" which would silently list all pages with invalid month numbers passed to {</font>{dts}}. Another method, coded in [[Template:Dts/ver]], leaves the default behavior unchanged, but allows an optional verify-switch "v=yes" when invoking dts:
:::{<font/>{dts/ver|v=yes |2009|78|55}} &nbsp; <--verify to report 78 & 55.
When a user sets "v=yes" then problems will display on the page:
:: &lt;br><font color="#CC8800">'''Template:dts''' - month "78" > 12 in "2009|78|55"</font>.
:: &lt;br><font color="#CC8800">'''Template:dts''' - day "55" > 31 in "2009|78|55"</font>.
That optional reporting allows each user to change pages to globally replace all "dts|" with "dts/ver|v=yes|" if they think those numbers should be reported. Of course, currently, the template handles any numbers for months/days, which some users might have assigned for special codes, such as day "32" sorts to the end of any month, so "v=yes" would be optional to allow day 32 (etc.) if used for special sorting.
 
See: [[Template:Dts/ver]] for more details. -[[User:Wikid77|Wikid77]] ([[User talk:Wikid77|talk]]) 12:38, 19 March 2009 (UTC)
 
==69% of omitted or swapped month/day are invalid==
''19-March-2009:'' Verifying the month/day can instantly detect problems in about 69% of cases, where month & day were swapped or month "12" was entered as "21". So verifying the date doesn't just find like 10% or 20% of problems, instead, verification finds almost two-thirds (65%) of all invalid, swapped dates. The total is, for days 13-31 being invalid months, and month "12" inverted as invalid "21":
:::: (31 - 12 + 1 for "21") / 31 = 20/31 ~= 64.52%.
Since November's month number 11 doesn't reverse, it is not a problem like December ("12" as "21"). However, if month or day are omitted, they are detected as "0" so that puts the chances of detecting an invalid date even higher than 65%, closer to 69%.
Hence, computer-verified dates are a major advantage, in nearly 69% of those common data-entry errors. -[[User:Wikid77|Wikid77]] ([[User talk:Wikid77|talk]]) 13:14, 19 March 2009 (UTC)
 
==Nowrap==
What about nowrap functionality? It is particularly useful for dates, which tend to get broken into two lines. Of course, one could say:
<nowiki>{{nowrap|{{dts|2009|1|1}}}}</nowiki>
but wouldn't
<nowiki>{{dts|nowrap=on|2009|1|1}}</nowiki>
be better? [[User:GregorB|GregorB]] ([[User talk:GregorB|talk]]) 19:29, 15 April 2009 (UTC)
 
: The template can be forced to nowrap by default if people think that makes more sense. There might be some fringe cases where that is unhelpful, though, like in a table where the columns are very narrow. <font face="Verdana">[[User:Gary King|<font color="#02b">Gary&nbsp;<b>King</b></font>]]&nbsp;([[User talk:Gary King|<font color="#02e">talk</font>]])</font> 02:46, 16 April 2009 (UTC)
 
::Nowrap may well be the default but - as you've noted - this could cause problems (but to what extent, it's hard to say). What I had in mind is to add the nowrap option, but make it default to "off" so as to be on the safe side by not changing the behavior of existing transclusions. This could be the initial setup, at any rate. [[User:GregorB|GregorB]] ([[User talk:GregorB|talk]]) 06:52, 16 April 2009 (UTC)
::I tried to find an existing table that could cause problems with dts nowrap, but I could not find any. On the other hand, I found many that would benefit from nowrap. So yes, I'd say nowrap=on would really make sense as the default. [[User:GregorB|GregorB]] ([[User talk:GregorB|talk]]) 09:18, 16 April 2009 (UTC)
:::Did it. The new parameter is "nowrap", and it defaults to "'''on'''". If there are major problems with this, feel free to revert. Minor problems in individual articles should be fixable by setting nowrap to "off"; I haven't found such cases thus far. I'll update the template documentation shortly. [[User:GregorB|GregorB]] ([[User talk:GregorB|talk]]) 12:05, 27 April 2009 (UTC)
 
== Changes to the template ==
=== New functionality ===
I've added the capacity for the template to handle a date as a single parameter. The default formatting is the same (month-day-year) but only applies to ISO input (international format is left as is). It accepts abbreviated month names. It corrects capitilisation and comma mistakes. It uses {{[[mw:Help:Extension:ParserFunctions#.23time:|#time:]]}} and so is limited to what the parser function can handle (e.g. it won't go beyond 100 AD). It ignores <code>link=on</code>.
 
{|
|-
|<pre>
*ISO
**{{dts|1990-09-03}}
**{{dts|1990-09-03|format=dmy}}
**{{dts|1990-09-03|format=mdy}}
 
 
 
*International
**{{dts|12 March 1990}}
**{{dts|12 March 1990|format=dmy}}
**{{dts|12 March 1990|format=mdy}}
 
**{{dts|12 Mar 1990}}
**{{dts|12 Mar 1990|format=dmy}}
**{{dts|12 Mar 1990|format=mdy}}
 
 
 
*US
**{{dts|March 23, 1990}}
**{{dts|March 23, 1990|format=dmy}}
**{{dts|March 23, 1990|format=mdy}}
 
**{{dts|Mar 23, 1990}}
**{{dts|Mar 23, 1990|format=dmy}}
**{{dts|Mar 23, 1990|format=mdy}}
 
 
 
*Wrong
**{{dts|12 March, 1990}}
**{{dts|March 23 1990}}
**{{dts|12 march 1990}}
**{{dts|MARCH 23, 1990}}
</pre>
|
*ISO
**{{dts|1990-09-03}}
**{{dts|1990-09-03|format=dmy}}
**{{dts|1990-09-03|format=mdy}}
 
*International
**{{dts|12 March 1990}}
**{{dts|12 March 1990|format=dmy}}
**{{dts|12 March 1990|format=mdy}}
**{{dts|12 Mar 1990}}
**{{dts|12 Mar 1990|format=dmy}}
**{{dts|12 Mar 1990|format=mdy}}
 
*US
**{{dts|March 23, 1990}}
**{{dts|March 23, 1990|format=dmy}}
**{{dts|March 23, 1990|format=mdy}}
**{{dts|Mar 23, 1990}}
**{{dts|Mar 23, 1990|format=dmy}}
**{{dts|Mar 23, 1990|format=mdy}}
 
*Wrong
**{{dts|12 March, 1990}}
**{{dts|March 23 1990}}
**{{dts|12 march 1990}}
**{{dts|MARCH 23, 1990}}
|}
 
[[User:Jimp|J<small>IM</small>p]]<sub>&nbsp;[[User talk:Jimp|talk]]·[[Special:Contributions/Jimp|cont]]</sub> 00:38, 4 August 2009 (UTC)
 
=== New coding ===
I've also somewhat rewritten the coding for the old functionality. There had been an error whereby <code>|link=on|format=dmy</code> would give a date with month-day-year formatting. In the process of fixing that I changed the code a little. This invloved adding some subtemplates:
 
*{{lt|dts/fmtdmy}}
*{{lt|dts/fmtmdy}}
*{{lt|dts/lkoff}}
*{{lt|dts/lkon}}
 
The first two are for formatting & the second are for linking/nonlinking. [[User:Jimp|J<small>IM</small>p]]<sub>&nbsp;[[User talk:Jimp|talk]]·[[Special:Contributions/Jimp|cont]]</sub> 00:50, 4 August 2009 (UTC)
 
== Linking ==
I propose that the linking function
#not be mentioned on the doc page and
#eventually be removed.
 
Date linking is to be discouraged. Having it mentioned here as an option may give editors the impression that it's okay. Is there any conceivable reason to link dates in the sort of tables that this template is designed for?
 
Once we can be sure that there are no <code>link=on</code>s left we could get rid of the option altogether. How can we be sure? Well, yes, there was something of an alterior motive to my fixing the template up. [http://en.wikipedia.org/wiki/Special:WhatLinksHere/Template:Dts/lkon Here's] the list of pages which have <code>link=on</code>. [[User:Jimp|J<small>IM</small>p]]<sub>&nbsp;[[User talk:Jimp|talk]]·[[Special:Contributions/Jimp|cont]]</sub> 01:01, 4 August 2009 (UTC)
 
== Is this intentional? ==
For years BC we get a different hidden number depending on whether it's input as a negative year or as a year BC.
*{{<code>dts|1000|||BC|debug=yes</code>}} → "{{dts|10000|||BC|debug=yes}}"
*{{<code>dts|-1000|debug=yes</code>}} → "{{dts|-10000|debug=yes}}"
 
Is there a reason for this?
 
This brings me to another question. Why do we have these fancy numbers for years BC and zeros in front of years AD at all? Plain negative numbers should work just fine, right?
 
{| class="wikitable sortable"
|+
|-
! Word
! Numeral
|-
| one thousand
| 1000
|-
| zero
| 0000
|-
| negative one thousand
| -1000
|-
| negative two thousand
| -2000
|}
 
[[User:Jimp|J<small>IM</small>p]]<sub>&nbsp;[[User talk:Jimp|talk]]·[[Special:Contributions/Jimp|cont]]</sub> 14:08, 4 August 2009 (UTC)