Difference between revisions of "Template:Days ago"
m (fixed Norwegian) |
|||
Line 17: | Line 17: | ||
| pl = Dzisiaj | | pl = Dzisiaj | ||
| pt = Hoje | | pt = Hoje | ||
+ | | pt-br = Hoje | ||
| ro = Astăzi | | ro = Astăzi | ||
| ru = Сегодня | | ru = Сегодня | ||
Line 38: | Line 39: | ||
| pl = wczoraj | | pl = wczoraj | ||
| pt = Ontem | | pt = Ontem | ||
+ | | pt-br = Ontem | ||
| ro = Ieri | | ro = Ieri | ||
| ru = вчера | | ru = вчера | ||
Line 58: | Line 60: | ||
| no = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dag|dager}} siden | | no = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dag|dager}} siden | ||
| pt = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dia|dias}} atrás | | pt = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dia|dias}} atrás | ||
+ | | pt-br = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dia|dias}} atrás | ||
| pl = {{#expr:{{LOCALDAY}} - {{{2|}}}}} dni temu | | pl = {{#expr:{{LOCALDAY}} - {{{2|}}}}} dni temu | ||
| ro = acum {{#expr:{{LOCALDAY}} - {{{2|}}}}} zile | | ro = acum {{#expr:{{LOCALDAY}} - {{{2|}}}}} zile | ||
Line 66: | Line 69: | ||
}} | }} | ||
}}{{#if:{{{brackets|}}}||)}}</includeonly><noinclude> | }}{{#if:{{{brackets|}}}||)}}</includeonly><noinclude> | ||
− | {{translation switching|cs, de, es, fi, fr, hu, it, ja, ko, nl, pt, pl, ro, ru, sv, zh-hans, zh-hant}} | + | {{translation switching|cs, de, es, fi, fr, hu, it, ja, ko, nl, pt, pt-br, pl, ro, ru, sv, zh-hans, zh-hant}} |
{{doc begin}} | {{doc begin}} | ||
This template makes use of [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions ParserFunctions] in the MediaWiki software to calculate the amount of days past since a specified date. Its main usage is on the {{tl|Latest updates}} template that appears on the [[Main Page]]. As the code of this template can be quite complex, {{tl|Days ago/core}} is used to hold the mathematical expressions and {{tl|Days ago}} handles language translations. | This template makes use of [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions ParserFunctions] in the MediaWiki software to calculate the amount of days past since a specified date. Its main usage is on the {{tl|Latest updates}} template that appears on the [[Main Page]]. As the code of this template can be quite complex, {{tl|Days ago/core}} is used to hold the mathematical expressions and {{tl|Days ago}} handles language translations. |
Revision as of 16:54, 11 November 2010
This template uses translation switching. The correct language will be displayed automatically. Localized versions of this template (e.g. Template:Days ago/ru) are not necessary. Add your translations directly to this template by editing it. Supported languages for this template: cs, de, es, fi, fr, hu, it, ja, ko, nl, pt, pt-br, pl, ro, ru, sv, zh-hans, zh-hant (add) |
Documentation for Days ago
This template makes use of ParserFunctions in the MediaWiki software to calculate the amount of days past since a specified date. Its main usage is on the {{Latest updates}}
template that appears on the Main Page. As the code of this template can be quite complex, {{Days ago/core}}
is used to hold the mathematical expressions and {{Days ago}}
handles language translations.
Usage
{{Days ago|9|2}}
(Month is9
, date is2
) generates Lua error in Module:Age at line 96: attempt to perform arithmetic on local 'day' (a nil value). days ago{{Days ago|9|2|brackets=0}}
generates Lua error in Module:Age at line 96: attempt to perform arithmetic on local 'day' (a nil value). days ago
Limitations
Currently {{days ago}}
cannot handle days spanning multiple months. For example, if the given date is August 29 and the current date is September 2, the template will produce a null output.