Template talk:Date

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Filing cabinet icon.svg

SpBot archives all sections tagged with {{Section resolved|1=~~~~}} after 5 days. For the archive overview, see Special:PrefixIndex/Template talk:Date/Archive .

Give an option to switch hCalendar off[edit]

Hello, I would like to request to add a parameter like |hCalendar=no, with which it's possible to turn this hCalendar off. There are sometimes circumstances in which this isn't doing anything good (for example when using with Category: formatting). This doesn't mean that it should be switched off be default, no, it's a great thing, just to make it possible. For example, it's planned to turn it off in {{Creator}}, so that it's possible to categorize with the {{{Date}}} parameter. What is your opinion on this? --The Evil IP address (talk) 14:31, 27 September 2009 (UTC)

Merge with Other date[edit]

I think, this template should be unified and merged with {{other date}}. --ŠJů (talk) 22:01, 5 December 2009 (UTC)

<time>[edit]

Mediawiki now support the time HTML5 tag that is done in order to improve machine readability of dates (spec). It's now the recommended way to add date in microformats. I have modified the sandbox version of the template to add support of <time>. The dates are now outputted using an HTML tree like: <time class="dtstart" datetime="2009-01-09">2012 January 9</time>. I have also added a new parameter to the template, "class" that is done in order to allow to change the class of the time node in templates like {{Creator}}. What do you think about this change? Can an admin merge this change in the template? Tpt (talk) 20:26, 4 December 2012 (UTC) {{editrequest}}

This last change is producing undesirable results in other templates that depend upon {{date}}, as for example {{monthbyyear}}: {{ucfirst:{{date|2013|6|4=pt}}}} should display "Junho de 2013", but because of the invisible markup tag the ucfirst stopped working and "junho de 2013" is displayed instead. Is this <time> tag really necessary? Capmo (talk) 05:39, 24 May 2013 (UTC)
Hi. I see the broken behaviour when visiting a page with a {{delete}} tag and using ?uselang=es (or any other language than English). However, we cannot leave this edit request template live forever. If you would like, you can post on COM:VP about this. When making edit requests, please post specific changes (code) you would like. Killiondude (talk) 20:52, 4 July 2013 (UTC)
The change I request is quite obvious: revert the last edit that introduced microformats and think of another way of doing it! Capmo (talk) 05:19, 5 July 2013 (UTC)
Hi. Please make a version you wanted be applied on a test page and link that here for admins then put {{editprotected}} again. Thank you :) −ebraminiotalk 21:31, 6 November 2013 (UTC)

Vietnamese[edit]

{{edit protected}}

Please add a case for Vietnamese (vi) below the existing Thai (th) case:

|vi      ={{#expr:{{{3|}}}}} {{I18n month|{{{2|}}}|{{{4|}}}}} {{#if: {{{1|}} | năm {{{1}}} }}

I've implemented this change at Template:Date/sandbox. Thank you!

 – Minh Nguyễn (talk, contribs) 09:08, 25 April 2014 (UTC)

✓ DoneSmiley.svg Thank you --Jarekt (talk) 12:27, 25 April 2014 (UTC)

Nowrap[edit]

{{editrequest}} I suggest to put the date in a <span>...</span> container with style="white-space:nowrap", because date in a line wrap look always very disturbing. -- Perhelion 21:05, 19 May 2014 (UTC)

Can you show us examples of dates with and without "wrap" and say why one is better than the other?--Jarekt (talk) 13:40, 27 May 2014 (UTC)
Everywhere where the date is in continuous text, for example Template:Centralized discussion, Commons:Transition to SVG (in the first box) Ok it is not often, that the date is on a longer continuous line, but I think it can't hurt to look. -- Perhelion 18:10, 27 May 2014 (UTC)
Please excuse my ignorance, but the purpose of this change is so the date always stay on the same line, right? --Jarekt (talk) 18:33, 27 May 2014 (UTC)
I'm also a little apologetic of my harsh kind (…). Specifically, it only means that the date will not be parted, it can also slide on a new line. (PS: as you can see in my signature) -- Perhelion 09:02, 28 May 2014 (UTC)
✓ Done--Jarekt (talk) 11:46, 28 May 2014 (UTC)

Template rewrite using Lua Module:Date[edit]

After extensive testing I just released a new version of Date template written entirely in Lua and based mostly on {{#time}} parser function, see Module:Date. The aim of the rewrite was to preserve ALL of the Template:date outputs. {{ISOdate}} might follow after more testing. Please alert me if mew version causes any issues. --Jarekt (talk) 18:51, 17 June 2014 (UTC)

Bug for triple-digit dates[edit]

{{date|642}} =>

It should read 642, not 0642. Magog the Ogre (talk) (contribs) 01:08, 4 July 2014 (UTC)

@Jarekt: ping, as this is likely related to your module update. Magog the Ogre (talk) (contribs) 01:09, 4 July 2014 (UTC)
The old code, when formatting for english, did not zero-pad the year, but it preserved any leading zeros from the year if the user zero-padded the year themselves. The new Lua code always zero-pads to a four-digit year. I'm not sure which is the preferred behavior. With the old code dates with two-year digits could end up looking like "10 May 12", which is very ambiguous (i.e. for that date is the year 10, 12, 2010, or 2012?). Do you think the correct behavior should be to use three digits for years in the range of 100-999, but four digit years for 0-99 (or maybe just years 0-31)? —RP88 (talk) 02:09, 4 July 2014 (UTC)
I don't think the situation you're mentioning is actually a problem; I'm not sure that any single piece of art prior to 100AD has a known date more specific than the year. And in the rare case that we detect one, I'm thinking it's probably uploader error, and the file should be placed into an incorrect template parameter category. Magog the Ogre (talk) (contribs) 02:33, 4 July 2014 (UTC)
So your preference would be to never zero-pad the year, or perhaps never zero-pad the year if only a year is supplied (even if the user supplies a zero padded year)? —RP88 (talk) 02:37, 4 July 2014 (UTC)
(edit conflict) I personally find padded years much less ambiguous, for example "August 0023" is much more clear than "August 23" which can be confused with "23 August". That is why when I noticed that {{#time}} function pads the years I assumed that that is preferred behavior. But I agree with RP88 that years in range 100-999 are not ambiguous (actually 32-999) and much more likely to be used and may be those should be stripped. That might be something to ask about on the VP. --Jarekt (talk) 02:45, 4 July 2014 (UTC)
By the way removing the padding can be easily done on the final strings by regexp replacement of "0\d\d\d", "00\d\d" and "000\d". That could take care of most languages that use western Arabic numerals. There is probably some clever way to catch all cases for all languages. --Jarekt (talk) 03:06, 4 July 2014 (UTC)
Let's move this discussion to a larger forum. See Commons:Village_pump#Date_formatting_used_by_.7B.7Btl.7CInformation.7D.7D_and_other_infobox_templates--Jarekt (talk) 14:33, 7 July 2014 (UTC)