Template talk:Date/Archive 1

Latest comment: 10 years ago by Whym in topic Problem with output

Use in hCalendar microformat

I am proposing to emit an hCalendar microformat (see the Microformats Project for background) from {{Information}}. This will require a template to output the date in ISO8601 format (YYYY-MM-DD or variants), wrapping it in class="dtstart". (This should apply to the date of the image (not the date of the upload).

I would like to make use of this template to do that, using it like "Start date" on Wikipedia-en, which outputs the date in both human-friendly and ISO formats (as "25 January 3009 (2009-01-25)", hiding the later, including the parentheses, with CSS. Before I add the code, does anyone have any questions or concerns? Or alternative suggestions? (there's some previous discussion from 2007; and Event start time). Andy Mabbett (talk) 11:44, 25 January 2009 (UTC)

I have no objctions as long as it is hidden. --Slomox (talk) 21:47, 25 January 2009 (UTC)
I have now done so, but there is a white-space issue, and no leading zero. For instance on File:Mokka pot parts and cup.jpg, the output is 16 February 2005 ( 2005 -2 -16), not the desired 16 February 2005 (2005-02-16). Can someone assist, please? Andy Mabbett (talk) 11:35, 3 February 2009 (UTC)
Please test your code before doing several edits to a now highly used template. You too got the 'class' declaration wrong.
I repaired it (at least I think so). Why do microformats use such short and unspecific class designators? That could easily lead to conflicts, couldn't it? --Slomox (talk) 15:56, 3 February 2009 (UTC)
Sorry about that; thank you for fixing my error and the issues mentioned above. The matter of "namespacing" classnames, or using profiles, is addressed at length on microformats wiki, but, in short the chances of a collision of an element with class="dtstart" inside another with class="vevent" are slim, Andy Mabbett (talk) 19:37, 3 February 2009 (UTC)
Ah, okay, "vevent" will go to Template:Information, right? Makes it less likely. But still I would have expected some kind of prefixing like "mcf-vevent". The vCard microformat even uses three and two letter class names. That _will_ lead to conflicts on the CSS level. --Slomox (talk) 20:38, 3 February 2009 (UTC)
Yes to the former (and likewise "vcard" wrapping hCard microformats); as I said, your latter point is oft discussed on the microformats wiki, and something of a religious divide for some; I'm ambivalent (though I don't think conflicts are inevitable). Andy Mabbett (talk) 21:03, 3 February 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Not all variables have to be set

Multichill, you edited the template with comment Not all variables have to be set. The check you removed checked not for all variables be set, but for any variable. If all three parameters are empty, nothing should be displayed. At the moment the template indeed displays nothing with no parameters given even without the check. But with additional formatting syntax for additional languages this could change. When I added correct format for German and Low Saxon for example, I had to make an extra edit ([1]), cause otherwise the empty template would have displayed a single dot. A check for at least any parameter being set is more secure (and safes us from running through much syntax when it is clear that this syntax will do exactly nothing). --Slomox (talk) 12:41, 25 January 2009 (UTC)

This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Finnish date format

Hi! In Finnish date format, "ta" suffix is added to the month name only if the day of month is also included. E.g. "20 March 2009" is "20. maaliskuuta 2009" but "March 2009" is "maaliskuu 2009". At the moment, the latter is not working as it should. Thus, the code should be modified as follows:

|fi      ={{#if: {{{3|}}} | {{#expr: {{{3}}} }}. }} {{#if: {{{2|}}} | {{I18n month|{{{2}}}}}{{#if: {{{3|}}} |ta}} }} {{{1|}}}

Thanks in advance! --Apalsola tc 22:10, 20 March 2009 (UTC)

Done. --Slomox (talk) 22:20, 20 March 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

English format

Mediawiki supports some native date formatting by using [[2009-03-23]]. This will render as 2009-03-23 (your personal preferred date format as provided in the "date and time" section of the preferences). But it only works with English. Should we add a line

|en={{#if: {{{3|}}} | [[{{{1|}}}-{{{2|}}}-{{{3}}}]] | {{I18n month|{{{2|}}}}} {{{1|}}} }}

? That would render English dates in the date format of personal preference for English language users. Or would there be any disadvantages? --Slomox (talk) 13:36, 23 March 2009 (UTC)

Two disadvantages: It doesn't work with years before 1000 (could be fixed) and the dates will be linked. As the links are not really useful, I won't change the code. --Slomox (talk) 17:01, 23 March 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

specify lang

I want to add an additional parameter to make it possible to specify the language in which the date should be rendered. Would it be better to call this parameter {{{4}}} or something like {{{lang}}}? --Slomox (talk) 16:20, 26 March 2009 (UTC)

It's called {{{4}}} now and implemented. --Slomox (talk) 23:12, 1 April 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Japanese Date Format

Please add to Japanese date format (YYYY年M月D日).

Code
|ja ={{{1|}}}年{{I18n month|{{{2|}}}|ja}}{{#if: {{{3|}}} |{{#expr:{{{3|}}}}}日}}

--Monaneko (talk) 06:29, 19 April 2009 (UTC)

Done. --Slomox (talk) 08:19, 19 April 2009 (UTC)

It gives an extra whitespace after the year. Could you change the code to the following?

 |ja      ={{#expr:{{{1|}}}}}年{{I18n month|{{{2|}}}|ja}}{{#if: {{{3|}}} |{{#expr:{{{3|}}}}}日}}

Presumably the same trick should be done to Chinese messages. Thank you in advance. --Aotake (talk) 22:55, 11 July 2009 (UTC)

Done to Japanese, Chinese and Lithuanian (which had the same problem). --Slomox (talk) 12:46, 14 July 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Esperanto date format

Could please some administrator add this line for Esperanto?

|eo      ={{#if: {{{3|}}} | la {{#expr: {{{3}}} }}-a de}} {{I18n month|{{{2|}}}}} {{{1|}}}

By the way, it is very impractical that fast all the templates are locked – for any change I have to beg somebody. Besides, ex. now I am not absolutely sure that my proposition is correct, nevertheless in case of malfunction, the only ability is to beg somebody anew, in hope of rapid solution. --Petrus Adamus (talk) 10:33, 1 May 2009 (UTC)

I added it.
About the protection: The template is used on 1.2 million pages (and the number is increasing fast). Edits by vandals or very unexperienced users could easily break all those 1.2 million pages. That non-admins have to ask for edits been done is the lesser of the two evils. --Slomox (talk) 14:29, 1 May 2009 (UTC)

{{Editprotected}} Could you please supercede it by this line? I think this date format is better in this use.

|eo      ={{#if: {{{3|}}} | {{#expr: {{{3}}} }}}} {{I18n month|{{{2|}}}}} {{{1|}}}

--Petrus Adamus (talk) 18:15, 17 May 2010 (UTC)

  DoneJuliancolton | Talk 01:00, 19 May 2010 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

English date

Hello, why the english date format is 28 April 2009 instead of 28th April 2009 ? Regards, Otourly (talk) 14:06, 2 May 2009 (UTC)

I myself pointed you to this page on Template talk:Information#English date, but I also already answered your question. --Slomox (talk) 20:05, 2 May 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Use it in Flinfo

Hi there, I've been thinking about using this template at Flinfo. Since I also have time data there, I wonder what I should do with it? Inserting something like {{date|2008|3|14}} at 12:24 doesn't seem like a really good idea to me. On the other hand Template:Time is used for something else. What should I do? --Flominator (talk) 19:40, 4 May 2009 (UTC)

At User:Slomox/test2 I created new code for Template:ISOdate, so it will be able to also handle a notation like "2009-05-04 12:55:13". Result:
हिन्दी: User:Slomox/test2
At the moment the (non-elaborate) code to handle the time of day is at User:Slomox/test3. It could be integrated into Template:Date, but I guess, that would make it too complicated. It would be better to place it in a template of itw own. Template:Time would be possible, it's not occupied anymore. But we would need a third place that combines the results of Template:Date and Template:Time. Some languages may need special separators. It could be either integrated into Template:ISOdate or in a template of its own. --Slomox (talk) 23:29, 4 May 2009 (UTC)
Using Template:Time sounds good. Why do we need a template that combines the results? What about Template:Datetime? --Flominator (talk) 18:29, 6 May 2009 (UTC)
Why do we need a template that combines the results? We need to store information about what type of connector to use between date and time somewhere. Some languages may want to separate it with a plain space ("4 May 2009 12:55:13"), some maybe with a comma ("4 May 2009, 12:55:13"), some with a specific word ("4. Mai 2009 um 12:55:13") or whatever else. Either we need to store a list of separators somewhere or a template, that combines date and time and contains the sepatators. --Slomox (talk) 18:57, 6 May 2009 (UTC)
I changed {{ISOdate}}. You can now simply write "2008-03-14 12:24" in the "date" parameter of {{Information}}. --Slomox (talk) 21:39, 6 May 2009 (UTC)
Does that mean I don't need to include any further template? --Flominator (talk) 06:12, 9 May 2009 (UTC)
If I understood Flinfo right, it makes use of {{Information}} and of no separate template, is that right? Then you can just write "|date=2008-03-14 12:24" and it will work. --Slomox (talk) 13:00, 9 May 2009 (UTC)
Yes, it uses the information template. I've changed the date format now, see for yourself. Thanks, --Flominator (talk) 15:41, 9 May 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Portuguese date format

The preposition "de" is getting connected to the month name, i.e. "9 dejaneiro de 2009". It should be "de janeiro", with "de" and the month name "janeiro" disconnected. Thanks, Malafaya (talk) 22:00, 19 June 2009 (UTC)

Fixed. --Slomox (talk) 22:44, 19 June 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Chinese Date Format

The Chinese date format is the same as that of Japanese. So you can just copy the date code of Japanese for Chinese (zh, zh-hant and zh-hans). Thank you very much for your help.--Altt311 (talk) 16:35, 24 June 2009 (UTC)

Done. I added zh-cn and zh-tw too (I assume that they are identical, if zh-hant and zh-hans are identical). --Slomox (talk) 17:14, 24 June 2009 (UTC)
Yes, all Chinese Date formats are identical. Thank you very much!--Altt311 (talk) 17:38, 24 June 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Croatian data format

Hi. In croatian after day and year go "." For example: "2009-06-30" in croatian is "30. lipnja 2009."

Could please someone add this line for Croatian?

|hr      ={{#if: {{{3|}}} | {{#expr: {{{3}}} }}.}} {{I18n month|{{{2|}}}|hr}} {{#if: {{{1|}}} | {{{1|}}}.}} 

I am not sure that my proposition is correct, but we can try. Thnx in advance --Ex13 (talk) 09:49, 30 June 2009 (UTC)

Done. String was almost correct. But {{#if: {{{1|}}} | {{{1|}}}.}} must be {{#if: {{{1|}}} | {{#expr: {{{1|}}} }}.}}. This strips whitespaces, which otherwise can occur between the number and the dot. (I too didn't realize it until I had done the edit and tested it. It's no obvious error ;-) ) --Slomox (talk) 12:07, 30 June 2009 (UTC)
Thank you. It works :) --Ex13 (talk) 12:43, 30 June 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Hungarian date format

Please add Hungarian format:

| hu = {{{1}}}. {{I18n month|{{{2|}}}|hu}} {{#if: {{{3|}}} | {{#expr: {{{3}}} }}.}}

--Tgr (talk) 23:34, 28 August 2009 (UTC)

Done. --Slomox (talk) 00:54, 29 August 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Extra space after the year

{{{1}}}. results in 2007 . (there is an extra space between the last digit and the dot), there must be extra whitespace somewhere in the template.

(You can use {{if:1|{{{1}}}}} to trim a string, though it is an ugly and probably unstable hack.)

--Tgr (talk) 06:43, 1 September 2009 (UTC)

The problem is known and is handled correctly in all the other languages. {{#expr: {{{1}}} }} is used for it, this should be stable if we presume that only valid numbers are passed to the template (it would fail if something like "01-02" is passed to the parameter, but as that string would be meaningless in the context of the template anyways, that should pose no problem).
When I updated the template with the Hungarian string above, I didn't notice that it contains an instance of this. But now I fixed it. --Slomox (talk) 10:34, 1 September 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Serbian

{{Editprotected}} Could someone please add:

|sr ={{#if: {{{3|}}} | {{#expr: {{{3}}} }}. }} {{I18n month|{{{2|}}}|sr|}} {{{1|}}}.

(Pay attention to the end dot.) Nikola (talk) 18:45, 16 September 2009 (UTC)

  Done - Huib talk 19:12, 16 September 2009 (UTC)

{{Editprotected}}

I made a correction:
|sr ={{#if: {{{3|}}} | {{#expr: {{{3}}} }}. }} {{I18n month|{{{2|}}}|sr|}} {{#expr: {{{1|}}} }}.
Nikola (talk) 14:36, 21 September 2009 (UTC)
  Done Kwj2772 (msg) 15:39, 21 September 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Hungarian

In Hungarian code year parameter is required but it shouldn't be. Old code:

|hu      ={{#expr:{{{1}}}}}. {{I18n month|{{{2|}}}|hu}} {{#if: {{{3|}}} | {{#expr: {{{3}}} }}.}}

Please change the code to the following:

|hu      ={{#if: {{{1|}}} | {{#expr: {{{1|}}} }}. {{I18n month|{{{2|}}}|hu}} {{#if: {{{3|}}} | {{#expr: {{{3}}} }}.}}

Thanks – BáthoryPéter (talk) 21:46, 19 November 2009 (UTC)

It should be
|hu      ={{#if: {{{1|}}} | {{#expr: {{{1|}}}. }} {{I18n month|{{{2|}}}|hu}} {{#if: {{{3|}}} | {{#expr: {{{3}}} }}.}}
shouldn't it? With the dot in the parentheses, cause you need no dot, if there's no year. Is that right? --Slomox (talk) 23:53, 19 November 2009 (UTC)

Of course :) Sorry, I was a little bit tired yesterday... – BáthoryPéter (talk) 12:01, 20 November 2009 (UTC)

  Done. (Both our versions were wrong, btw, the position of the dot was correct, but there was no closing bracket for the if-statement. I fixed that ;-) ) --Slomox (talk) 17:40, 21 November 2009 (UTC)

Thanks! :) – BáthoryPéter (talk) 19:59, 21 November 2009 (UTC)

This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Hungarian again

{{Editprotected}} Hungarian code needs a little modification because of special suffixes of the language. Btw sometimes there is no need dot after the day:

|hu      ={{#if: {{{1|}}} | {{#expr: {{{1|}}} }}. }} {{I18n month|{{{2|}}}|hu}} {{#if: {{{3|}}} | {{#expr: {{{3}}} }}{{#if: {{{form|}}} | | . }} }}

For example: "1 January" = "január 1.", but "on 1 January" = "január 1-én" (without dot). I made some template ({{-én-án}}, {{-hez-hoz}}) to determine the suffix. – BáthoryPéter (talk) 19:01, 6 December 2009 (UTC)

  Done but next time triplecheck first. --grin 14:10, 16 December 2009 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Month in Russian

{{editprotected}}

In Russian, the month in the full date comes in the genetive form (form=gen), e.g. 21 декабря 2009. However, if the day of month is omitted, the month must come in the nominative form, e.g. декабрь 2009. Could this please be fixed? Thank you. --Duchesse (talk) 22:07, 21 December 2009 (UTC)

  Done, should be fixed now. --The Evil IP address (talk) 22:24, 21 December 2009 (UTC)
Thank you! --Duchesse (talk) 14:50, 22 December 2009 (UTC)

Please update genitive form of monthnames for other date cases (as in pl section):

|ru = {{#if: {{{3|}}} | {{#expr: {{{3}}} }} {{I18n month|{{{2|}}}|ru|form=gen}} | {{I18n month|{{{2|}}}|ru|form={{#if:{{{form|}}}|{{{form|}}}}}}} }} {{{1|}}}

--Kaganer (talk) 18:27, 30 March 2011 (UTC)

  Done --Jarekt (talk) 20:50, 30 March 2011 (UTC)
Thankks, all OK ;) --Kaganer (talk) 10:48, 31 March 2011 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Portuguese format

I am not sure if this is the right place to change something, but I have noticed two issues in dates format for Portuguese:

  • If the language is set to Brazilian Portuguese (pt-BR), a date 2009-12-31 would be displayed as "31 dezembro 2009", when it should be "31 de dezembro de 2009". But this is strange, as there is no "pt-BR" row in the template.
  • As of the latest Portuguese Ortographic Agreement, which became effective in 2009, the names of the months in Portuguese should not be capitalized. However, if European Portuguese (pt) is the selected languange, although the des are present, the names of the months are still capitalized (i.e., it would be "31 de Dezembro de 2009"). Could this be changed here?

As it is possible to conclude, after the agreement, both Portuguese versions should display dates in the same format, as in "31 de dezembro de 2009".

Opraco (talk) 05:32, 29 January 2010 (UTC)
But this is strange, as there is no "pt-BR" row in the template That's the problem. As Template:Date uses a simple switch there's no fallbacking. Therefore "pt-br" will end up in the "#default" row. If we add a "pt-br" row, it will be fixed. I'll do that.
I fixed the date case problem too.
Test: pt: 31 de dezembro de 2009, pt-br: 31 de dezembro de 2009. --Slomox (talk) 18:00, 29 January 2010 (UTC)
Problem fixed, sorry for the miss-spelling in the summary. Otourly (talk) 16:27, 11 September 2010 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Interlingua format

Here is a line for adding the date format in IALA's Interlingua (ia):

|ia ={{#if: {{{3|}}} | {{#expr: {{{3}}} }} de}} {{#if: {{{2|}}} | {{I18n month|{{{2|}}}|ia}} }} {{{1|}}}

Should produce "5 de martio 2010" for the date of writing.

Thanks – McDutchie (talk) 20:31, 5 March 2010 (UTC)

  Done--Jarekt (talk) 13:40, 1 June 2010 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Belarusian (Taraškievica) and Belarusian translations

I suppose it to be something like:

|be ={{#if: {{{3|}}} | {{#expr: {{{3}}} }} }} {{#if: {{{3|}}} | {{I18n month|{{{2|}}}|be|form=gen}} | {{I18n month|{{{2|}}}|be}} }} {{{1|}}}
|be-tarask ={{#if: {{{3|}}} | {{#expr: {{{3}}} }} }} {{#if: {{{3|}}} | {{I18n month|{{{2|}}}|be-tarask|form=gen}} | {{I18n month|{{{2|}}}|be-tarask}} }} {{{1|}}}

Wizardist (talk) 10:18, 31 May 2010 (UTC)

Hey! Who maintains this template? Wizardist (talk) 11:13, 1 June 2010 (UTC)
  Done --Jarekt (talk) 13:39, 1 June 2010 (UTC)
Cut the </nowiki> tag for be-tarask :) Thanks Wizardist (talk) 15:20, 2 June 2010 (UTC)
  Done Opps --Jarekt (talk) 16:16, 2 June 2010 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Add Macedonian (mk)

{{Editprotected}} Can I have the Macedonian (mk) date format added?

|mk={{#if: {{{3|}}} | {{#expr: {{{3}}} }} }} {{I18n month|{{{2|}}}|mk|}} {{#expr: {{{1|}}} }}

Thanks a lot. --B. Jankuloski (talk) 06:58, 21 July 2010 (UTC)

  Done Cbrown1023 talk 13:17, 21 July 2010 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Add Galician

Please add Galician (gl) translation.

|gl      ={{#if: {{{3|}}} | {{#expr: {{{3}}} }} de}} {{#if: {{{2|}}} | {{I18n month|{{{2|}}}|gl}} de }} {{{1|}}}

Thanks! --Toliño Fala aquí comigo 18:25, 22 October 2010 (UTC)

  Done Thanks --Jarekt (talk) 19:30, 22 October 2010 (UTC)

This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

pt-BR fix

{{edit protected}} This switch apparently does not work properly with Brazilian Portuguese, as it misses the de prepositions between the values (gives 1 novembro 2010 when it should be 1 de novembro de 2010). I would guess changing |pt-BR to lowercased |pt-br would solve the problem. Thaks, Opraco (talk) 00:07, 2 November 2010 (UTC)

  Done --Mormegil (talk) 17:18, 2 November 2010 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Malayalam

{{editprotected}} Pls add:

|ml       = {{#if: {{{1|}}} |{{#expr:{{{3|}}} }}  {{I18n month|{{{2|}}}|ml}}  {{#expr:{{{1|}}} }}|{{I18n month|{{{2|}}}|ml}} {{#expr:{{{3|}}} }} }}

Thanks--Praveen:talk 11:00, 2 December 2010 (UTC)

  Done --Jarekt (talk) 15:36, 2 December 2010 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Add Bavarian

{{Edit request}} Please add the Bavarian language in the source:

|bar     ={{#if: {{{3|}}} | {{#expr: {{{3}}} }}.}} {{I18n month|{{{2|}}}|bar}} {{{1|}}}

Thanks in advance --Labant (talk) 16:19, 3 December 2010 (UTC)

  Done --Jarekt (talk) 16:13, 4 December 2010 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Error with English dates

This is not necessarily a {{Date}} error, but at the moment {{Date|2011|04|29}} produces "29 {{MediaWiki:April/<lang>}} 2011" if the user language is English. Other languages (at least de, fi and sv) seem to work OK. ––Apalsola tc 22:06, 28 April 2011 (UTC) –– (cleanup) Apalsola tc 22:09, 28 April 2011 (UTC)

Already discussed at Commons:Village pump#Information template date display problems. ––Apalsola tc 22:09, 28 April 2011 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Slovene

{{Editrequest}} Please, correct sl. It should use the genitive form with the format YYYY-MM-DD per default (like Slavic group 2). The period after the day (DD.) should remain. Thanks a lot. --Eleassar (t/p) 10:49, 27 September 2012 (UTC)

That sounds a little like 'cs' version. I changed {{Date/sandbox}} please verify, if correct.
Current {{Date}}:
  • {{date|2009|1|9|sl}} → 9. januarja 2009
  • {{date|2009|1|9|sl|form=}} → 9. januarja 2009
  • {{date|2009|1|9|sl|form=nom}} → 9. januarja 2009
  • {{date|2009|1|9|sl|form=gen}} → 9. januarja 2009
  • {{date|2009|1|9|sl|form=ins}} → 9. januarja 2009
  • {{date|2009|1|sl}} → januar 2009
  • {{date|2009|1|sl|form=}} → januar 2009
  • {{date|2009|1|sl|form=nom}} → januar 2009
  • {{date|2009|1|sl|form=gen}} → januar 2009
  • {{date|2009|1|sl|form=ins}} → januar 2009
Proposed {{Date/sandbox}}:
  • {{date/sandbox|2009|1|9|sl}} → 9. januarja 2009
  • {{date/sandbox|2009|1|9|sl|form=}} → 9. januarja 2009
  • {{date/sandbox|2009|1|9|sl|form=gen}} → 9. januarja 2009
  • {{date/sandbox|2009|1|9|sl|form=ins}} → 9. januarja 2009
  • {{date/sandbox|2009|1|sl}} → januar 2009
  • {{date/sandbox|2009|1|sl|form=}} → januar 2009
  • {{date/sandbox|2009|1|sl|form=gen}} → januar 2009
  • {{date/sandbox|2009|1|sl|form=ins}} → januar 2009
--Jarekt (talk) 12:06, 27 September 2012 (UTC)
That's ok. --Eleassar (t/p) 12:10, 27 September 2012 (UTC)
  Done --Jarekt (talk) 13:45, 27 September 2012 (UTC)
Ok, great. Thanks. I only don't know how to get the nominative now, which I would use in Template:Picture of the day/sl. It's accusative actually, but has the same form as nominative in this case. --Eleassar (t/p) 10:38, 28 September 2012 (UTC)
{{date|2009|1|9|sl|form=}} → 9. januarja 2009 is the same as {{date|2009|1|9|sl}} → 9. januarja 2009. I hope that answers your question. --Jarekt (talk) 11:58, 28 September 2012 (UTC)
This just tells me that we don't have the nominative for Slovene now (both instances are written as 19. januarja 2009), which is unacceptable. The default form should be the genitive (with -ja suffix), but it should be possible to set the nominative (with zero suffix). --Eleassar (t/p) 14:01, 28 September 2012 (UTC)
I think I finally understand the issue. I modified {{Date/sandbox}}. Please verify current and proposed behavior in the examples above. --Jarekt (talk) 14:58, 28 September 2012 (UTC)
This seems ok now. Thanks a lot! --Eleassar (t/p) 17:16, 28 September 2012 (UTC)
  Done I Moved the code from {{Date/sandbox}} to {{Date}}. --Jarekt (talk) 17:27, 28 September 2012 (UTC)

{{Editprotected}} As this has been reverted for other languages, can you enable it only for sl (it's in a separate line)? --Eleassar (t/p) 19:33, 28 September 2012 (UTC)

I can but the reason for revert is likely also valid in sl. I do not see any difference between ru and sl versions other than period after the day, so the code should not differ much more than that. --Jarekt (talk) 19:49, 28 September 2012 (UTC)
I haven't actually seen what exactly was wrong in Russian. In Slovene everything was ok until the edit was reverted, now it isn't. Can you please restore the previous state for sl? Otherwise please point out the exact error, because I don't see it. --Eleassar (t/p) 21:45, 28 September 2012 (UTC)
You can find more details about the issue at User_talk:A.Savin#.7B.7BDate.7D.7D --Jarekt (talk) 01:43, 1 October 2012 (UTC)
Eleassar, I modified {{I18n month}} so now it can take "form=nom" parameter passed from {{Date}}. See Example above. Will that work for you?--Jarekt (talk) 15:33, 1 October 2012 (UTC)
Yes, it does work. Thank you. --Eleassar (t/p) 08:12, 2 October 2012 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Iberian languages

{{Editrequest}} The Portuguese, Galician and Spanish languages format dates in the form "day de month de year". However, the preposition de should only be included if there are at least two parameters: day+month, month+year or day+month+year, otherwise it should be left out. This is not happening currently: {{date|2=6|4=pt}} displays "junho de" when the expected would be only "junho". Can it be fixed, please? Capmo (talk) 05:54, 24 May 2013 (UTC)

The following code will do it:

{{#if: {{{3|}}} | {{#expr: {{{3}}} }} {{#if: {{{2|}}} | de }}}} {{#if: {{{2|}}} | {{I18n month|{{{2|}}}|{{{4|}}}}} {{#if: {{{1|}}} | de }}}} {{{1|}}}

Capmo (talk) 06:12, 24 May 2013 (UTC)

  Done. Testing:
  • {{date|3=1|2=6|1=2000|4=pt}} -> 1 de junho de 2000
  • {{date|3= |2=6|1=2000|4=pt}} -> junho de 2000
  • {{date|3=1|2=6|1= |4=pt}} -> 1 de junho
  • {{date|3=1|2= |1=2000|4=pt}} -> 2000
  • {{date|3= |2=6|1= |4=pt}} -> junho
  • {{date|3= |2= |1=2000|4=pt}} -> 2000
  • {{date|3=1|2=6|1=2000|4=pt-br}} -> 1 de junho de 2000
--Jarekt (talk) 02:55, 30 May 2013 (UTC)
This section was archived on a request by: whym (talk) 12:31, 3 November 2013 (UTC)

Two questions

Two questions:

  • At Special:WhatLinksHere/Template:Date there are 6 files in the list, but only three of them actually use the template. What's going on here?
  • If we'd change Template:Information to use this template, we'll have ISO date. Should we use {{date| {{#time: Y | {{{date|}}} }} | {{#time: m | {{{date|}}} }} | {{#time: d | {{{date|}}} }} }} or should we directly make this template able to handle ISO, so we could write {{date| {{{date|}}} }}?
  • Btw: Days with leading zeros will be rendered with those leading zeros. At least in the German/Low Saxon time format this is no wanted behaviour. (I just note it down, so I don't forget about it. It's a minor issue and easy to fix.) --Slomox (talk) 06:21, 24 January 2009 (UTC)
I fixed the leading zero.
I forgot about the pitfalls of non-complete ISO dates, when handled by {{#time: }}. I created Template:ISOdate with some logic to catch all the flaws. In Template:Information we could insert {{ISOdate|{{{Date|}}}{{{date|}}}}}. It would correctly format all ISO dates in formats like "1957", 1957-09", "1957-09-28" and display the original string if the parameter is not in that format. --Slomox (talk) 11:59, 25 January 2009 (UTC)
Template:ISOdate still fails in two cases: Dates in format "07-09-2008" and in format "07-09-08". The first could be fixed and displayed correctly with improved logic, but the latter is undecidable and should be displayed in the unformatted original. --Slomox (talk) 12:22, 25 January 2009 (UTC)
"07-09-2008" will now be rendered correctly. For "07-09-08" I'm still not sure, what should be allowed and what not. --Slomox (talk) 13:10, 25 January 2009 (UTC)
"07-09-08" will fail, as long as no number (or more than one) exceeds 31. The template produces meaningful results in all testcases now (see the list at User:Slomox/test2). --Slomox (talk) 16:10, 25 January 2009 (UTC)
This section was archived on a request by: whym (talk) 04:04, 9 November 2013 (UTC)

Other calendars

I'd like to add support for the Thai solar calendar, which is the most common date format in Thailand according to Wikipedia (en:Thai solar calendar).

The code is:

|th ={{#if: {{{3|}}} | {{#expr: {{{3}}} }} }} {{I18n month|{{{2|}}}|th}} {{#if: {{{1|}}} | {{#ifexpr: {{{1}}} <= 1940 | {{#if: {{{2|}}} | {{#ifexpr: {{{2|}}} < 4 | พ.ศ. {{#expr: {{{1}}} + 542 }} | พ.ศ. {{#expr: {{{1}}} + 543 }} }} | {{other date|or|{{#expr: {{{1}}} + 542 }}|{{#expr: {{{1}}} + 543 }}|th}} }} | พ.ศ. {{#expr: {{{1}}} + 543 }} }} }}

It takes into account the calendar change of 1941. If only a year is provided and no day and month, there is no way to decide which Thai year it is before 1941. So {{Date|1900|||th}} for example would be rendered as "2442 หรือ 2443" ("หรือ" is "or"). Exact dates before 1941 will be rendered correctly and unambigously.

Any objections about adding this?

If that'll work, I will add support for the Ethiopian calendar too and other calendar systems, if they are the most common systems in their respective languages. --Slomox (talk) 23:11, 1 April 2009 (UTC)

This section was archived on a request by: whym (talk) 04:04, 9 November 2013 (UTC)

Concurrency

This template is great and I use it all the time, but it's a perfect example of discontinuity between Commons and en:wiki. At en wiki, this template exists as well, but it requires input in a different way. Here it's {{Date|2009|05|06}} while at en:wiki it's {{Date|2009-05-06}}. Can't we make them the same so they work in both places the same way? It would make it much easier for users that hop between the two projects. ~ ωαdεstεr16«talkstalk» 05:00, 6 May 2009 (UTC)

We have {{ISOdate|2009-05-06}} for that… :-/ --Mormegil (talk) 10:15, 6 May 2009 (UTC)
This template is great and I use it all the time You don't need to use it if it's in a template's "date" parameter (Like in the "date" parameter of {{Information}}). The templates can handle the dates on their own.
Good to know, even though CommonsHelper formats all dates into {{Date}} now (that's where I first discovered the template). ~ ωαdεstεr16«talkstalk» 17:39, 6 May 2009 (UTC)
The templates cannot work in the same way, cause a) they do different things (on en.wp it only adds some flexibility in formatting the date, while on Commons we _have to_ apply very, very different formatting styles to enable multilinguality), and b) why should there be en.wp/Commons continuity at all? Why not continuity with en.ws or fr.wp or yi.wb? --Slomox (talk) 15:07, 6 May 2009 (UTC)
Make it universal then! But then again, note that if you did it in, say, Spanish, it would be {{Fecha}}. Make the Commons version the universal one (since multiple languages make it necessary) and have the local WPs follow suit for convenience. This template formats the date to the preference of the user. British/Australian users at en:wiki prefer 6 May 2009, while Americans prefer May 6, 2009. While there's minimal language barrier, there is a date barrier, so the "multilingual" aspect is still notable even at en:wiki. ~ ωαdεstεr16«talkstalk» 17:34, 6 May 2009 (UTC)
CommonsHelper needs to use it, cause it puts two things in the parameter: the date originally provided by the author and the date of the original upload. The template can only handle the date automatically if it's the only content of the parameter. Actually CommonsHelper putting the original upload date in the parameter is data junk, cause the original upload date is already present in the upload history and the "date" parameter is specifically for the date of creation and not for the date of the upload. I already informed the operator of the CommonsHelper bot, but he hasn't yet changed anything about this.
About universal templates: The idea of a "library" of templates which are available on every wiki and which work in a reliable and predictable and uniform way, would be a very good thing to have. But it will only work with a central repository. As long as every wiki maintains its own physical copy of a template, the templates will always drift apart. Requiring a central repository, the idea is tightly connected with the ideas of a central repository for interwikis and the Wikidata idea. All of these things are yet unsolved, cause voluntary developers have not yet created a solution that fits the demand of the tech staff for "the perfect" solution. --Slomox (talk) 18:11, 6 May 2009 (UTC)
Tho I use Commonshelper a lot, it puts a lot of junk on an image page. I have yet to figure out why it puts that "moved" template at the top. It's the least important aspect of an image. And yea, Commons could really be the ultimate "media repository" if we could centralize our templates... sigh. ~ ωαdεstεr16«talkstalk» 20:01, 6 May 2009 (UTC)
This section was archived on a request by: whym (talk) 04:04, 9 November 2013 (UTC)

Problem on Chinese date format

{{Editprotected}} There is a problem on the year parameter of Chinese date format. The Chinese character for year (年) still appears even the year parameter is not used. (Problem can be seen in Template:Day gallery header, where 年 appears mistakenly) The character should appear only if the year parameter is used. Would admins please fix this problem as soon as possible? Thanks in advance.--Lkopeter (talk) 08:09, 5 December 2009 (UTC)

Please change the code to the following:
 |zh      ={{#if: {{{1|}}} |{{#expr:{{{1|}}}}}年}}{{I18n month|{{{2|}}}|zh}}{{#if: {{{3|}}} |{{#expr:{{{3|}}}}}日}}
 |zh-hans ={{#if: {{{1|}}} |{{#expr:{{{1|}}}}}年}}{{I18n month|{{{2|}}}|zh-hans}}{{#if: {{{3|}}} |{{#expr:{{{3|}}}}}日}}
 |zh-hant ={{#if: {{{1|}}} |{{#expr:{{{1|}}}}}年}}{{I18n month|{{{2|}}}|zh-hant}}{{#if: {{{3|}}} |{{#expr:{{{3|}}}}}日}}
 |zh-cn   ={{#if: {{{1|}}} |{{#expr:{{{1|}}}}}年}}{{I18n month|{{{2|}}}|zh-cn}}{{#if: {{{3|}}} |{{#expr:{{{3|}}}}}日}}
 |zh-tw   ={{#if: {{{1|}}} |{{#expr:{{{1|}}}}}年}}{{I18n month|{{{2|}}}|zh-tw}}{{#if: {{{3|}}} |{{#expr:{{{3|}}}}}日}}
Thanks again.--Lkopeter (talk) 10:55, 5 December 2009 (UTC)
  Done I fixed Korean also. Kwj2772 (msg) 14:29, 5 December 2009 (UTC)
Thank you. It seems that the Japanese one also gets the same problem. Would you mind fixing the problem as well?--Lkopeter (talk) 17:40, 5 December 2009 (UTC)
This section was archived on a request by: whym (talk) 04:04, 9 November 2013 (UTC)

Problem with output

See Template talk:ISOdate#Problem with hidden formatting for a problem in this template. --  Docu  at 21:54, 5 February 2012 (UTC)

I see the issue. Anybody knows what <span style="display:none">(<span class="dtstart">{{padleft:{{{1}}}|4|0}}{{#if: {{{2|}}}|-{{padleft:{{{2}}}|2|0}}}}{{#if: {{{3|}}}|-{{padleft:{{{3}}}|2|0}}}}</span>)</span> does? --Jarekt (talk) 11:47, 6 February 2012 (UTC)
Not sure, probably some defunct feature. Let's scrap it. --  Docu  at 10:08, 11 February 2012 (UTC)
This section was archived on a request by: whym (talk) 04:04, 9 November 2013 (UTC)
Return to "Date/Archive 1" page.