![]() | 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. |
Archive 1 | Archive 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.—Wikibarista 17:16, 21 March 2007 (UTC)
The acronym is great, but unfortunately, it's being 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. —Wikibarista 18:02, 21 March 2007 (UTC)
Centralized discussion for all issues surrounding sortkeys for wikitables created here: Template talk:Sort. ~ trialsanderrors 09:02, 5 April 2007 (UTC)
My Special:Preferences have the date presentation set to "2001-01-15T16:12:34". Yet when template is passed {{dts|15|January|2001}}
I get the output of "15 January 2001". Surely I should be seeing the same output as what [[January 15]] [[2001]]
would give me, which is "2001-01-15". What's gone wrong? --Oscarthecat 16:46, 10 April 2007 (UTC)
Great work this weekend! I noted dts doesn't play nice with {{sortdate}} in the same table. I might be wrong on that, I'll have to look later. —Wikibarista 00:28, 17 April 2007 (UTC)
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 (t c) 14:43, 26 April 2007 (UTC)
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 ( {{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. Gary King (talk) 02:36, 26 March 2008 (UTC)
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". Truthanado (talk) 00:15, 15 September 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. Lightmouse (talk) 13:30, 25 October 2008 (UTC)
Thanks. Lightmouse (talk) 17:37, 26 October 2008 (UTC)
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? PC78 (talk) 23:16, 23 October 2008 (UTC)
{{dts||10|25}}
will show as October 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 2008-10-25
). Gary King (talk) 21:19, 25 October 2008 (UTC)
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. Lampman (talk) 13:24, 21 February 2009 (UTC)
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. -Wikid77 (talk) 12:38, 19 March 2009 (UTC)
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.
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 {{dts}}. Another method, coded in Template:Dts/ver, leaves the default behavior unchanged, but allows an optional verify-switch "v=yes" when invoking dts:
When a user sets "v=yes" then problems will display on the page:
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. -Wikid77 (talk) 12:38, 19 March 2009 (UTC)
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":
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. -Wikid77 (talk) 13:14, 19 March 2009 (UTC)
What about nowrap functionality? It is particularly useful for dates, which tend to get broken into two lines. Of course, one could say:
{{nowrap|{{dts|2009|1|1}}}}
but wouldn't
{{dts|nowrap=on|2009|1|1}}
be better? GregorB (talk) 19:29, 15 April 2009 (UTC)
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 {{#time:}} and so is limited to what the parser function can handle (e.g. it won't go beyond 100 AD). It ignores link=on
.
*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}} |
|
JIMp talk·cont 00:38, 4 August 2009 (UTC)
I've also somewhat rewritten the coding for the old functionality. There had been an error whereby |link=on|format=dmy
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:
The first two are for formatting & the second are for linking/nonlinking. JIMp talk·cont 00:50, 4 August 2009 (UTC)
I propose that the linking function
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 link=on
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. Here's the list of pages which have link=on
. JIMp talk·cont 01:01, 4 August 2009 (UTC)
link=on
-- just ignore it in the template code. Some dates that were linked will then come up not linked, but I'm all for that. The documentation page should then describe link=on
and link=off
as former parameters that have no effect and should be removed when encountered.. . . . Jim . . . . Jameslwoodward (talk • contribs) 12:56, 22 September 2009 (UTC)link=on
"s left. It shouldn't be too hard to eliminate any "link=off
"s that might exist. Once there are no "link=
"s at all we can safely put the issue to rest since it will only be of historical interest for which mention in talk archives is sufficient. I've changed the doc to better reflect the fact that this is a former parameter which should no longer be used & removed when found. JIMp talk·cont 17:45, 22 September 2009 (UTC)For years BC we get a different hidden number depending on whether it's input as a negative year or as a year BC.
dts|1000|||BC|debug=yes
}} → "1000 BC"dts|-1000|debug=yes
}} → "1000 BC"Is there a reason for this?
JIMp talk·cont 14:08, 4 August 2009 (UTC)
This template generates output that causes WP:ACCESSIBILITY problems. For example, "{{dts|1776|July|4}}
" generates output "July 4, 1776" that the Lynx text browser renders as "01776-07-04 July 4, 1776", and I assume that screen readers used by the visually impaired have similar misfires. Is this sort of problem inherent to what {{dts}} is trying to do with respect to sortable tables? At any rate, the bug (or accessibility issue) should be documented, no? Eubulides (talk) 07:26, 14 September 2009 (UTC)
Tables are often places where place is limited. Currently it always outputs the full month. There should be an option to have it output three letter months (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) or AP style months (Jan., Feb., March, April, May, June, July, Aug., Sept., Oct., Nov., Dec.). Headbomb {ταλκκοντριβς – WP Physics} 23:45, 23 September 2009 (UTC)
dts|31 Dec 2000
}} → "31 Dec 2000". JIMp talk·cont 13:57, 24 September 2009 (UTC)
{{dts|2000|September|31|format=dmy|months=3L}} |
→ | (31 Sep 2000), |
{{dts|2000|09|31|format=dmy|months=3L}} |
→ | (31 Sep 2000), |
{{dts|2000|Sep|31|format=mdy|months=AP}} |
→ | (Sept. 31, 2000). |
format=dmy
giving ymd. Has it yet been settled that we'll be using AP in tables (or at all)? JIMp talk·cont 19:44, 24 September 2009 (UTC)
format=dmy
when it should be "31 Sep 2000". JIMp talk·cont 20:57, 24 September 2009 (UTC)
List of Kansas City Royals managers has a sort bug in the last column, labeled "WS". Can anybody figure it out? I know that this doesn't strictly concern {{dts}}, but this talk page is frequented by more editors so I thought I might as well give it a shot. Dabomb87 (talk) 00:06, 29 September 2009 (UTC)
ts_resortTable()
JavaScript function used to sort tables, because if you change the colspan
in the bottom row to "2", then add another column in that row, then WS sorts fine. So it appears to be a bug in the sorting function. Gary King (talk) 00:39, 29 September 2009 (UTC)
I was surprised to see this template was unprotected, since this is being used in a lot of pages. Is there a particular reason this is not protected? I've just semi protected it indefinitely, but maybe it should be given full protection. ≈ Chamal talk ¤ 11:06, 24 October 2009 (UTC)
The template is not showing up in the List of WWE Tag Team Champions (under the date column) for me (and I asked on IRC, and it's not showing for other users as well and I tried both IE and Firefox). I checked the history, and I couldn't find a time when it did work, so it must be something in the template. What makes this weird is that it works perfectly on this page: List of World Tag Team Champions (WWE). Does anyone have any ideas as to what is going on? -- Scorpion0422 20:23, 23 December 2009 (UTC)
Wouldn't this accomplish the same thing?
{{nk|{{date|{{{1}}}|iso}}|{{date|{{{1}}}}}}}
~ 10nitro (talk) 20:15, 3 January 2010 (UTC)
What is the difference between this template and {{Start date}}? Erik (talk) 22:33, 10 March 2010 (UTC)
This isn't a problem with {{dts}}, but it may be interesting to other users of {{dts}}: There is apparently a limit to the number of occurrences of #time in a single wiki page. I reported the problem to MediaWiki here: http://www.mediawiki.orghttps://demo.azizisearch.com/lite/wikipedia/page/Help_talk:Extension:ParserFunctions#.23time_limit (click the link for more details). This means large sortable tables (i.e. more than 100 rows) should use the {{dts|yyyy|mm|dd}} format instead of {{dts|yyyy-mm-dd}} format. Johnson487682 (talk) 14:36, 15 June 2010 (UTC)
According to dts documentation, {{dts|2010-07-04}} output should be U.S. "July 4, 2010". But in Wikipedia in culture the output of dts appears to always be yyyy-mm-dd. Is this a bug? --Lexein (talk) 08:52, 9 January 2011 (UTC)
If the template can display just the year "2005", how about displaying month/year? "October 2005". Any way to do that? Also it would have been nice if all the code was in one template for easily reproducing this on another wiki. --Justpassingthrough2 (talk) 17:14, 20 February 2010 (UTC)
{{dts|format=y|1992|2|7}}
it doesn't format the output properly. Can you update "format" values to display onyl the year-value ? -Paul
{{dts|1992}}
(output: 1992) will do what you want, to display only the year. Gary King (talk · scripts) 19:05, 25 February 2011 (UTC)Is it possible to enter a time interval such as January 11–15 and have it sort by the first (or last) date, i.e. as "January 11" or "January 15"? bamse (talk) 20:20, 26 February 2011 (UTC)
Please see Wikipedia:Village pump (technical)#Skype problem - processesing "invisible" text. Thanks, Rambo's Revenge (talk) 12:10, 27 May 2011 (UTC)
Wouldn't it be more appropriate to have the default format as international dating rather than American dating? Is this determined by the template or is it entirely based on user preferences? McLerristarr | Mclay1 02:28, 28 June 2011 (UTC)
Wikipedia is the first site in the world to create such horrible looking dates in text browsers. Keep your zeros to yourselves. Jidanni (talk) 03:34, 9 July 2011 (UTC)
Is it possible to create and add a new format with hidden year? For example:
dts|format=md|2010|March|29
}}<span style="display:none">02010-03-29</span> March 29
This format would be very useful in a table where all the dates are from one or two different years and the listing of years looks excessive. For example: in this table, all the dates are either in 2010 or 2011 (i.e. between July 2010 and June 2011) and listing the years would be a little bit redundant as the article title already mentions the years. Right now that table uses {{dts
}} templates without year such as: {{dts||March|29
}}. However it produces <span style="display:none">02012-03-29</span> March 29
and the entry will be sorted as March 29, 2012, which will create incorrect sorting in the table. — MT (talk) 06:39, 29 March 2012 (UTC)
dts|format=md|March 29, 2010
}}dts|format=md|2010|March|29
}}I've just discovered that years BC are not being coded correctly. The sorting code is out by 1 depending on whether the BC year is specified using BC
or by a negative year. Worse is the case of using BCE
, which is simply ignored.
dts|-2000|July|1
}} gives -7999-07-01dts|2000|July|1|BC
}} gives -8000-07-01dts|2000|July|1|BCE
}} gives 02000-07-01JIMp talk·cont 00:28, 25 April 2012 (UTC)
I'm working on a rewrite of the template to fix the problems mentioned above (plus some not mentioned). Besides fixing problems, though, what I'm also planning on is making the template default to abbreviating the month name. This template is used in tables where space is often tight and alignment is preferable. It is now possible to force the template to abbreviate the month & I've often done so but it means a little extra typing. It seems to me we'd be better off reversing this; let those who want the month name spelt out in full do the extra work. JIMp talk·cont 05:31, 27 April 2012 (UTC)
This may be of interest. {{dts|869-07-09}}
produces "July 9, 0869", with a leading zero as seen here. jonkerz♠ 08:55, 24 August 2011 (UTC)
dts|869-07-09
}} is fixed. JIMp talk·cont 11:59, 27 April 2012 (UTC)I've put the new code in place as mentioned above. Besides fixing the problems mentioned above it also makes the hidden code consistant, gets rid of false dates (e.g. outputting the current day of the month when it wasn't input) and allows dm, md, my, d, m & y formats in addition to mdy & dmy. I believe it'll also allow more transclusions (less code ... looks like more but it's actually less (not calling {{MONTHNAME}}, {{MONTHNUMBER}}, etc.)). JIMp talk·cont 12:09, 27 April 2012 (UTC)
Revert until consensus is demonstrated. The Rambling Man (talk) 17:12, 30 April 2012 (UTC)
I created Category:Pages with parser function time errors and added it to the interface page so it is automatically populated. It took me a while to figure out that this template hides the error message under certain circumstances:
Markup | Renders as |
---|---|
{{dts|8|15}} |
Error in Template:Date table sorting: months must be an integer between 1 and 12 |
{{dts|8|Novermber|2011}} |
Text output: Error in Template:Date table sorting: 'Novermber' is not a valid month Text output with debug: Error in Template:Date table sorting: 'Novermber' is not a valid month HTML output:
|
The month is misspelled in the second example. This results in an error, but it is hidden when it runs through {{dts/out}}. ---— Gadget850 (Ed) talk 13:55, 27 April 2012 (UTC)
I have noticed a common usage of this template, i.e. {{dts|format=dmy|2007-01-02}}, doesn't seem to work anymore. It used to render "2 January 2007", instead it now outputs "2 2007 2007". Anyone know what happened? Mushroom (Talk) 11:09, 3 May 2012 (UTC)
The template spells the name of the month out in full by default. If a user wanted the month name abbreviated, he/she had two options.
The second option is overridden if the format
parameter is used. I have added a new option in the form of a parameter abbr
.
abbr
to on
Note that this third option currently only works where the other two are not possible. JIMp talk·cont 23:27, 6 May 2012 (UTC)
dts|2010|5|7
}} use abbr
.
dts|1984|12|9
}} → December 9, 1984dts|1984|12|9|abbr=on
}} → Dec 9, 1984dts|2010-05-07
}} use abbr
.
dts|1984-12-09
}} → December 9, 1984dts|1984|12|9|abbr=on
}} → Dec 9, 1984dts|2010|May|7
}} spell out the date in full or abbreviate directly. abbr
is ignored.
dts|1984|December|9
}} → December 9, 1984dts|1984|December|9|abbr=on
}} → Dec 9, 1984dts|1984|Dec|9
}} → Dec 9, 1984dts|1984|Dec|9|abbr=on
}} → Dec 9, 1984dts|7 May 2010
}} it depends on whether the format
parameter is used. If the format
parameter is used, abbr
will work. If the format
parameter is not used, abbr
is ignored so spell out the date in full or abbreviate directly.
dts|9 December 1984
}} → 9 December 1984dts|9 December 1984|abbr=on
}} → 9 Dec 1984dts|9 Dec 1984
}} → 9 Dec 1984dts|9 Dec 1984|abbr=on
}} → 9 Dec 1984dts|9 December 1984|format=dmy
}} → 9 December 1984dts|9 December 1984|abbr=on|format=dmy
}} → 9 Dec 1984dts|9 Dec 1984|format=dmy
}} → 9 Dec 1984dts|9 Dec 1984|abbr=on|format=dmy
}} → 9 Dec 1984JIMp talk·cont 23:58, 6 May 2012 (UTC)
It's been two months since this template was last edited. But on none of the pages that link to it, dates show up correctly... Will this template be fixed or has it been replaced? DutchHoratius (talk) 22:41, 2 July 2012 (UTC)
Mergers by Microsoft
Comparison of Web browsers (specifically the release date columns in the release history table)
Condé Nast Publications
List of current United States governors
List of living cardinals
It could be your browser. The date is showing up for me. JIMp talk·cont 05:16, 14 July 2012 (UTC)
Hey everyone! Is it possible to have a more precise listing of date than YYYY-MM-DD? I'm looking at the ISO date format page, and wondering if YYYY-MM-DD HH:MM:SS is somehow permitted in Wikipedia.
Thanks! MakeItProper (talk) 21:29, 17 August 2012 (UTC)
I noticed from the examples in documentation have years starting with 0, from which I inferred support for display of the year 10,000 and beyound. Is this true? -Mardus (talk) 02:11, 27 October 2013 (UTC)
The "What is solves" section avers unequivocally that the "YYYY-MM-DD format...does not conform to the Manual of Style for date display". This is not completely correct. The MOS:DATE section allows that the format is sometimes "useful in long lists and tables for conciseness". The section should make it clear that, at least in the case of lists and tables, the editor has some latitude in the date format to be used. — Preceding unsigned comment added by 108.79.226.129 (talk) 16:32, 15 February 2013 (UTC)
Extremely unfortunate that this feature is totally incompatible with German WP tables that use dts coded with year at the end!
Error: 17 10 2002 This is not an acceptable date format. Please check the spelling, check the numbers and/or read the documentation at template
-71.174.188.43 (talk) 15:47, 17 January 2014 (UTC)
Please improve this dts code so that source fields with values 1xxx or 2xxx are auto-recognized as YEAR regardless of whether the field is first or last.-71.174.188.43 (talk) 22:48, 17 January 2014 (UTC)
The problem with that would be that some might think that {{dts|11|10|2002
}} were for November 10 rather than 11 October. Jimp 09:30, 26 March 2014 (UTC)
Hello,
what should I change to have two months listed without any errors? Regards.--Tomcat (7) 11:32, 20 February 2013 (UTC)
{{date sortable|May-June 2008}}
. However, dts should be upgraded to handle ranges, ideally allowing {{date sortable}} to be merged here. Dl2000 (talk) 15:43, 2 September 2013 (UTC)Is there a way to force one row before the other when they have the same date? The table has two entries defined by {{Dts|2011|06|23}}
, but one should still be shown before the other, which currently shows up wrong in old-new order (but correct for new-old order). I tried {{Sort|2011-06-23-[1 and 2]|June 23, 2011}}
and without the last dash, but that doesn't seem to work, in fact they don't show up between the other dates, they just show up at the bottom of the page. Anyone have some solution? Thanks. Xeworlebi (talk) 01:29, 30 July 2011 (UTC)
{{Sort|02011-06-23-[1 and 2]|June 23, 2011}}
might work (the template adds a zero). Jimp 16:57, 26 March 2014 (UTC)Currently, the template allows for sorting by adding hidden text in the format "02012-11-24". Would it be possible to add a parameter that would force a fourth chunk (i.e., "02012-11-24-01")? The purpose would be to force table items with the same date to sort in a particular order. For example, the sortable table at Justice of the Supreme Court of the United Kingdom has six judges all appointed on 1 October 2009. I wanted to force the table to sort them among themselves by the order in which they were appointed to the Supreme Court's predecessor Court. To do so, I used the following code:
<span style="display:none">02009-10-01-01</span>1 October 2009
<span style="display:none">02009-10-01-02</span>1 October 2009
So what I'm asking for is a parameter that would allow me to write {{dts}} to accomplish the same thing. -Rrius (talk) 12:07, 24 November 2012 (UTC)
addkey
, for this purpose. Jimp 09:32, 27 March 2014 (UTC)The option to hide the output, i.e. create the sort key only, has been added. To do this use format=hide
. Jimp 09:47, 27 March 2014 (UTC)
Is there any way to use dts to sort most recent to least recent by default? — Preceding unsigned comment added by Jeremyfrankly (talk • contribs) 16:43, 17 June 2014 (UTC)
Why not use <time> tag? It seems like it's designed specifically for this sort of usage. -- Andrew Shadura (talk) 14:11, 31 July 2014 (UTC)
Hi there, maybe a silly question - but how do I use this in my wiki? Do I need to copy the code of the Template:Dts and all subtemplates for this to work? Is there an easier way than viewing the source code for each subtemplate and coping it?
Thanks Anna Annaisakiwi (talk) 03:17, 2 October 2014 (UTC)
Is it possible to align date(s) to the centre of a table? — TPX 21:49, 18 March 2015 (UTC)
| style="text-align: center;" | {{dts|2015}}
I used the DTSH template on tables of fraternity installation dates in sortable tables when the only information available was season, so if I had three fraternity installations as February 1, 1940, Spring 1940 and May 13, 1940, I'd do them as {{dts|1940|2|1}}, {{dtsh|1940|4|1}}Spring 1940, and {{dts|1940|5|13}} how can I do this without dtsh?Naraht (talk) 00:47, 23 February 2015 (UTC)
|format=hidden
. Jimp 11:56, 19 March 2015 (UTC)Is it possible somehow to sort with a date range? For example, I have a list of events with the following dates "June 22 - July 3, 1956", "September 20 - October 5, 1946" and "August 1-20, 1934". --Gonnym (talk) 12:53, 14 June 2015 (UTC)
|format=hide
, and then display the date range manually. You may also want to prevent your dates from wrapping by using {{nowrap}}. For example, {{dts|1956|6|22|format=hide}}{{nowrap|June 22 - July 3, 1956}}
will give you "June 22 - July 3, 1956". — Mr. Stradivarius ♪ talk ♪ 04:23, 4 July 2015 (UTC)
|data-sort-value=000000002015-10-29-0000 |October 29–31, 2015
which wasn't pretty or scalable at all. Opencooper (talk) 17:42, 1 October 2015 (UTC)This may not be especially relevant, since automatic support of dates in table sorts has made this template a lot less necessary, but note that at Template:Dts/doc#Parameters, the list of format options is incomplete—the template also supports MDY to display dates in the 6/19/2025 format. —Salton Finneger (talk) 14:11, 1 July 2016 (UTC)
|format=mdy
is one of the options listed at Template:Dts/doc#Formatting, but it results in something like June 19, 2025, not 6/19/2025. Could you clarify? Best — Mr. Stradivarius ♪ talk ♪ 13:08, 5 July 2016 (UTC)
{{dts|5/7/2016}}
- it will give you <span class="sortkey" style="display:none;speak:none">000000002016-07-05-0000</span><span style="white-space:nowrap">5 July 2016</span>
. — Mr. Stradivarius ♪ talk ♪ 23:27, 5 July 2016 (UTC)
Would it be feasible without too much hassle to support quarter notation such as "Q1, 2017"? They should be sorted right after the last month of the quarter, e.g. after March 2017 for Q1, after June for Q2, etc. Also the notation for half-years "H1, 2017" is sometimes useful for government documents or future planned events with only a vague announced time range. — JFG talk 18:40, 5 November 2016 (UTC)
This template needs to implement wiki links. like
{{dts| 2005 | link=yes}}
which shows 2005 (not 2005). -- Leyth (talk) 20:16, 28 June 2017 (UTC)
A date like August 28, 2017 in one line is really long and widens your date column /whole table quite much and unnecessarily.
Fortunately there is the nowrap=off
option, which however doesn't deliver nice data since then it breaks after every date part, e.g.
August
28,
2017
... not really useful either. So I was wondering to have this option smarter in more refined way, so that it would only wrap the year? Maybe with a specific option like wrap=year
? Thanks! Wikiinger (talk) 19:47, 16 August 2017 (UTC)
Hi! In Alfred Auguste Nemours, dts is used but it prints '1926 – 1930' and this is not a correct date range format as per WP:DATERANGE, we need to remove the spaces and make it '1926–1930', how can I do that? Thanks. --ExperiencedArticleFixer (talk) 05:42, 22 January 2018 (UTC)
First example for the raison-d'être was:
1/8/2013 sorts alphanumerically before 5/3/1967, because 1 is less than 5;
This ambiguous format (m/d/yyyy? d/m/yyyy?) already must not be used on WP, which made for an invalid argument.
1 August 2013 sorts alphanumerically before 5 March 1967, because 1 is less than 5;
--Mathieu ottawa (talk) 16:59, 18 February 2018 (UTC)
I *think* that what needs to be added to the code is the following. After line 408 in Module:Dts where is says
if self.format == 'hide' then return '' end
I think adding an
if self.display then return self.display end
Not sure if the self.display test should simply be for existance or if it needs a <> ''. Don't know the language well enough (but I program for a living)Naraht (talk) 17:11, 19 February 2018 (UTC)
@Mr. Stradivarius: FYI, I have been slowly developing some age/date modules which work from 9999 BCE to 9999 CE. For example, {{extract}} can handle the current proposal above over that more limited range of years. It accepts dates in a variety of formats so 1945-05-27
and 1945|05|27
would work as well.
{{extract|27 May 1945|show=May 27–28|sortable=on}}
→ May 27–28I think you should make your change to dts and that it should continue to be used. I am mentioning the alternative only to make you aware that I hope to replace many of the age and date templates which have minor quirks and inconsistencies. I don't think there would be any benefit from replacing dts which is useful for its ability to handle very large years.
Module:Age and Module:Date do the work. The latter can produce a sort key based on the Julian day which allows accurate sorting of dates and times. The sort key increments by 1 for each day, and by fractional amounts if a time-of-day is specified, for example 6:00 am gives 0.25. It works from 9999 BCE to 9999 CE (dates before Julian day number 0 are regarded as negative and sort correctly). Johnuniq (talk) 00:24, 20 February 2018 (UTC)