Cannabis Ruderalis

Content deleted Content added
→‎Nowrap: Implemented
Jimp (talk | contribs)
Line 95: Line 95:
::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)
::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)
:::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)

== 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)

Revision as of 00:39, 4 August 2009

This is the discussion/talk page for: Template:Dts.

Topics from 2007-2008

Expand the features

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)[reply]

Being used outside of sorted tables

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)[reply]

Centralized discussion for all issues surrounding sortkeys for wikitables created here: Template talk:Sort. ~ trialsanderrors 09:02, 5 April 2007 (UTC)[reply]

Possible bugs

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)[reply]

I fixed it, it was due to a blank space in the year link: [[12 April]] [[2007 ]] gives 12 April 2007 .--Patrick 07:25, 12 April 2007 (UTC)[reply]
Thanks for the quick response Patrick. Yes, now working great. --Oscarthecat 20:32, 15 April 2007 (UTC)[reply]

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)[reply]

A-ha, I see it. dts has a leading 0 whereas sortdate does not. —Wikibarista 00:35, 17 April 2007 (UTC)[reply]
I have added the zero in sortdate.--Patrick 08:54, 3 May 2007 (UTC)[reply]

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)[reply]

It seems the limit per Wikipedia:Template limits is reached on the page. --User:Krator (t c) 15:07, 26 April 2007 (UTC)[reply]

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 ( {{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)[reply]

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". Truthanado (talk) 00:15, 15 September 2008 (UTC)[reply]

A lot of people who use this template might then wonder why the links are now off; they might think something is broken, perhaps. Gary King (talk) 03:00, 15 September 2008 (UTC)[reply]
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". Truthanado (talk) 11:32, 15 September 2008 (UTC)[reply]
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 :) Gary King (talk) 14:14, 15 September 2008 (UTC)[reply]
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! Mrh30 (talk) 09:27, 10 October 2008 (UTC)[reply]

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)[reply]

Done Gary King (talk) 19:02, 25 October 2008 (UTC)[reply]

Thanks. Lightmouse (talk) 17:37, 26 October 2008 (UTC)[reply]

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? PC78 (talk) 23:16, 23 October 2008 (UTC)[reply]

No, not with its current setup. Gary King (talk) 23:20, 23 October 2008 (UTC)[reply]
What I mean is, is it feasible to make this change to the template? PC78 (talk) 00:42, 24 October 2008 (UTC)[reply]
This feature was not implemented probably because it wasn't requested that often. It can be done, though. In which article it is needed? Gary King (talk) 04:27, 24 October 2008 (UTC)[reply]
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. PC78 (talk) 13:39, 25 October 2008 (UTC)[reply]
Okay done. {{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)[reply]
Many thanks! PC78 (talk) 13:21, 26 October 2008 (UTC)[reply]

Topics from 2009-2010

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. Lampman (talk) 13:24, 21 February 2009 (UTC)[reply]

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 {{sort}} to do what you want; the first parameter is for sorting, the second is for what you actually want to appear. Gary King (talk) 16:24, 21 February 2009 (UTC)[reply]

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. -Wikid77 (talk) 12:38, 19 March 2009 (UTC)[reply]

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.
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:

{{dts/ver|v=yes |2009|78|55}}   <--verify to report 78 & 55.

When a user sets "v=yes" then problems will display on the page:

<br>Template:dts - month "78" > 12 in "2009|78|55".
<br>Template:dts - day "55" > 31 in "2009|78|55".

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)[reply]

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. -Wikid77 (talk) 13:14, 19 March 2009 (UTC)[reply]

Nowrap

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)[reply]

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. Gary King (talk) 02:46, 16 April 2009 (UTC)[reply]
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. GregorB (talk) 06:52, 16 April 2009 (UTC)[reply]
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. GregorB (talk) 09:18, 16 April 2009 (UTC)[reply]
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. GregorB (talk) 12:05, 27 April 2009 (UTC)[reply]

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 {{#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}}
  • ISO
    • September 3, 1990
    • 3 September 1990
    • September 3, 1990
  • International
    • 12 March 1990
    • 12 March 1990
    • March 12, 1990
    • 12 Mar 1990
    • 12 Mar 1990
    • Mar 12, 1990
  • US
    • March 23, 1990
    • 23 March 1990
    • March 23, 1990
    • Mar 23, 1990
    • 23 Mar 1990
    • Mar 23, 1990
  • Wrong
    • 12 March 1990
    • March 23, 1990
    • 12 March 1990
    • March 23, 1990

JIMp talk·cont 00:38, 4 August 2009 (UTC)[reply]

Leave a Reply