Template talk:ISOdate

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Info non-talk.svg Template:ISOdate has been protected indefinitely because it is a highly-used or visible template. Use {{Edit request}} on this page to request an edit.
Please test any changes in the template's /sandbox or /testcases subpages, or in a user subpage, and consider discussing changes at the talk page before implementing them.
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:ISOdate/Archive .

Genetive form[edit]

I detected that {{Information}} which calls this template displays incorrect form of the date. In Belarusian (both be and be-tarask) the month name should be in genetive form, for example: 5 лютага 1999, not 5 люты 1999. In Russian it works fine (shows genetive form). When form month-year is used, default month name should be used: люты 1999. Is it able to be resolved? Wizardist (talk) 18:59, 15 April 2010 (UTC)

The exact formatting of the date is handled by {{Date}}. The Belarusian behaviour is the same as Russian, right? If you can confirm this, I can take the Russian formatting line and insert a corresponding line for Belarusian. --Slomox (talk) 21:29, 15 April 2010 (UTC)
Yes, the same as Russian. "Day MonthGen Year". Wizardist (talk) 15:18, 2 June 2010 (UTC)

Old date entries by CommonsHelper etc.[edit]

Some bot (maybe CommonsHelper?) moving files from Wikipedias filled the date field of {{Information}} template with entries in format "2006-08-06 (original upload date)" (an example here). But the hyphen-format of date is correctly localized only when it isn't followed by next text. As i can see here, it is possible to replace it with {{Original upload date|2006-08-06}}

  • 1) Can somebody transform (through a bot) all actual occurences of "(original upload date)" using the localizing template?
  • 2) Also there is wanted to replace (using a bot) all hyphen-shaped dates combined with posterior text with {{date}} or {{other date}} templates
  • 3) What about to modify the template {{ISOdate}} in such way that the sample {{ISOdate|2010-08-18 arbitrarytexttexttext}} would be represented as "18 August 2010 arbitrarytexttexttext" - this treatment can resolve also many other types of notes and comments added to the date
  • 4) There exist several special templates for distinguish the event which is related to the date or for origin of the date: {{According to EXIF data}}, {{Original upload date}}, {{Taken on}}. Also other similar ones should be created: {{firstly published}}, {{source published on}}, {{retouched on}}, {{panorama created on}} {{files combined on}}), {{created on}}, {{date of first version}}, {{date of last version}}
  • 5) What about to allow a type of event (meaning or source of the date) as a new parameter of {{ISOdate}} {{date}} or {{other date}} templates? Examples:
    {{date|2009|1|9|event=taken}} → taken on 9 January 2009
    {{ISOdate|2010-08-18 08:15|event=firstly published}}
    {{other date|circa|1999-05-01|2000-06-1|event=taken}}
    Typicall values can be also standardized and localized through special templates, other values can be used as a text
  • 6) Also parameter "time" should be added to {{date}} or {{other date}} templates in order to be full-featured equivalents of {{ISOdate}}
  • 7) Would be possible even to unify those templates and transform all {{date}} or {{other date}} to {{ISOdate}}?

--ŠJů (talk) 14:20, 30 November 2010 (UTC)

The "date" parameter should never contain original upload dates. They just don't belong in there. The original upload date should be present in the original upload history, which should be a section of its own below the {{Information}} template. So if we start a bot to touch "original upload date" information, the bot should rather eliminate the original upload dates from the "date" parameter (if it is present in the original upload history) or mark the file for review so a valid original upload history can be added.
What about to modify the template {{ISOdate}} in such way that the sample {{ISOdate|2010-08-18 arbitrarytexttexttext}} would be represented as "18 August 2010 arbitrarytexttexttext": That's technically impossible (at least with non-server-melting technical means).
About creating new date context templates: {{first published}} sounds okay, the date of publication is relevant for license questions, but most of the other templates sound like information mud to me. Of course we could theoretically provide e.g. {{files combined on}} information, but for what reason? Who would need that information? And if somebody needs it: why can't he look up the date in the file history where it should be present? If we have all these dates in the template it will draw away focus from the more relevant information and this disadvantage outweighs all possible benefits I can think of.
The "event" parameter thing sounds interesting. We should spend more thoughts on it and I would like to hear other opinions on it.
Also parameter "time" should be added to {{date}} or {{other date}} templates in order to be full-featured equivalents of {{ISOdate}}: Do you have any example where this would be useful? I guess it would be possible and I don't see any big drawbacks, but I also feel like this is hardly ever relevant.
Would be possible even to unify those templates and transform all {{date}} or {{other date}} to {{ISOdate}}? I guess it would be possible, but for what purpose? I guess the added complexity of a unified template would outweigh any possible benefits. --Slomox (talk) 18:12, 30 November 2010 (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) 00:54, 20 May 2014 (UTC)
Partially done. The date part was done in {{date}}. --Jarekt (talk) 11:51, 28 May 2014 (UTC)

Converting to Lua[edit]

So at WikiConference USA this template was brought to my attention as one that would benefit from being converted to Lua. So I took the liberty of doing so. The draft code is at [[Module::ISOdate]], and you can see it in action at User:Parent5446/Sandbox. I'm working on creating documentation and unit tests for it. If there is anything that looks wrong, please edit it or let me know. Parent5446 (talk) 03:32, 2 June 2014 (UTC)

User:Parent5446, thanks a lot - this is a great start. I copied your code to Module:date/sandbox (with other similar function) and started a battery of tests at Module:Date/sandbox/testcases (tests) and Module talk:Date/sandbox/testcases (test results) pages. The test code is not working right yet and the function itself does not behave the way current code does. The differences in behavior between Lua and Template versions should be evaluated and synched or discussed is Lua version is considered better. Much more testing will need to be done, but this is a great start. Thanks. --Jarekt (talk) 13:03, 2 June 2014 (UTC)

Remove invalid language codes[edit]

{{editprotected}} As noted in [1] [2], Arabic_indic and Ml_old are not valid m:language codes. Can they be removed from the template? --Nemo 21:20, 6 June 2014 (UTC)

I do not have time tonight to properly investigate this, but I will. Removing those 2 would help, since we have some special handling for those. However we supported them for a while so I will try to see why were they added and by whom. By the way, we are actively working on total rewrite of this template using module:Date/sandbox. So I would not be changing the current template, especially if it is not fixing any current pages, but I would drop the support in the new module. --Jarekt (talk) 03:21, 8 June 2014 (UTC)
I think the source of those 2 languages was Template:FormatnumDigit. However it is unclear if any language uses it and they are not supported by Template:Date used to format the rest of the date-time string. I will drop them from the new module module:Date/sandbox. --Jarekt (talk) 20:28, 9 June 2014 (UTC)

exotic language support[edit]

This template supports many very rarely used languages. I have a feeling some of them are really out of whack, but since there are no speakers who ever told us there is some problem it is never corrected. for example:

  • Mongolian: {{ISOdate|1=2010-08-18 08:15:30|2=mn}} gives ", ᠘: ᠑᠕: ᠓᠐", which can not be right as the year numbers use Western Arabic numerals, time numbers are in Mongolian and month is in Cyrillic. While at mn:Хэлэлцүүлэг:Нүүр_хуудас dates have format: "09:05, 16 Арванхоёрдугаар сар 2007"
  • There are more languages where year numbers use Western Arabic numerals, time numbers are not. That is unlikely to be correct
    • {{ISOdate|1=2010-08-18 08:15:30|2=te}} gives ", ౮: ౧౫: ౩౦"
    • {{ISOdate|1=2010-08-18 08:15:30|2=th}} gives ", ๘: ๑๕: ๓๐"
    • {{ISOdate|1=2010-08-18 08:15:30|2=bo}} gives ", ༠༨:༡༥:༣༠"
    • {{ISOdate|1=2010-08-18 08:15:30|2=pa}} gives ", ੦੮:੧੫:੩੦"
    • {{ISOdate|1=2010-08-18 08:15:30|2=hi}} gives ", ०८:१५:३०"
    • {{ISOdate|1=2010-08-18 08:15:30|2=gu}} gives ", ૦૮:૧૫:૩૦"
    • {{ISOdate|1=2010-08-18 08:15:30|2=lo}} gives ", ໐໘:໑໕:໓໐"
    • {{ISOdate|1=2010-08-18 08:15:30|2=or}} gives ", ୦୮:୧୫:୩୦"
  • LTR languages also seem to be wrong. fa:بحث:صفحهٔ_اصلی shows dates in the format "‏۲۴ مارس ۲۰۱۴، ساعت ۲۲:۰۸" while our template:
    • {{ISOdate|1=2010-08-18 08:15:30|2=ur}} gives ", ۰۸:۱۵:۳۰"
    • {{ISOdate|1=2010-08-18 08:15:30|2=mz}} gives ", 08:15:30"
    • {{ISOdate|1=2010-08-18 08:15:30|2=ckb}} gives ", ٠٨:١٥:٣٠"
    • {{ISOdate|1=2010-08-18 08:15:30|2=glk}} gives ", ۰۸:۱۵:۳۰"
    • {{ISOdate|1=2010-08-18 08:15:30|2=fa}} gives ", ۰۸:۱۵:۳۰"

In most of those languages using {{#time}} parser function defaults might be a better option. For example Mongolian or arabic:

  • {{#time:h:i:s, d F Y|2010-08-18 08:15:30|mn}} gives 08:15:30, 18 Наймдугаар сар 2010
  • {{#time:h:i:s, d F Y|2010-08-18 08:15:30|ar}} gives ٠٨:١٥:٣٠, ١٨ أغسطس ٢٠١٠

May be there is a way to look up the default date format for each wikipedia. Like "h:i, d F Y" seems to be the default for most. --Jarekt (talk) 15:15, 10 June 2014 (UTC)

Template:Date rewrite using Lua Module:Date[edit]

After extensive testing I just released a new version of template:Date 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. Since template:Date is at the core of this template, please alert me if new version causes any issues. --Jarekt (talk) 18:51, 17 June 2014 (UTC)