Difference between revisions of "Template:Days ago"
(using {{PLURAL:}} for some languages) |
(documentation) |
||
Line 61: | Line 61: | ||
}}{{#if:{{{brackets|}}}||)}}</includeonly><noinclude> | }}{{#if:{{{brackets|}}}||)}}</includeonly><noinclude> | ||
{{translation switching|cs, de, es, fi, fr, hu, it, ja, nl, pt, pl, ro, ru, sv, zh-hans, zh-hant}} | {{translation switching|cs, de, es, fi, fr, hu, it, ja, nl, pt, pl, ro, ru, sv, zh-hans, zh-hant}} | ||
+ | {{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]]. | ||
+ | |||
+ | == Usage == | ||
+ | * {{tlx|Days ago|9|2}} (Month is {{code|9}}, date is {{code|2}}) generates {{Days ago|9|2}} | ||
+ | * {{tlx|Days ago|9|2|4=brackets=0}} generates {{Days ago|9|2|brackets=0}} | ||
+ | |||
+ | == Limitations == | ||
+ | Currently {{tl|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. | ||
+ | |||
[[Category:Language templates|Days ago]] | [[Category:Language templates|Days ago]] | ||
</noinclude> | </noinclude> |
Revision as of 07:38, 9 September 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, nl, pt, 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.
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.