Difference between revisions of "Template:Days ago"

From Team Fortress Wiki
Jump to: navigation, search
m (dem brackets)
(move brackets to main page template)
Line 4: Line 4:
 
| day  = {{{3}}}
 
| day  = {{{3}}}
  
| today = ({{lang
+
| today = {{#if:{{{br|}}}|(}}{{lang
 
   | cs = Dnes
 
   | cs = Dnes
 
   | de = Heute
 
   | de = Heute
Line 25: Line 25:
 
   | zh-hans = 今天
 
   | zh-hans = 今天
 
   | zh-hant = 今天
 
   | zh-hant = 今天
   }})
+
   }}{{#if:{{{br|}}}|)}}
| yesterday = ({{lang
+
 
 +
| yesterday = {{#if:{{{br|}}}|(}}{{lang
 
   | cs = Včera
 
   | cs = Včera
 
   | de = Gestern
 
   | de = Gestern
Line 47: Line 48:
 
   | zh-hans = 昨天
 
   | zh-hans = 昨天
 
   | zh-hant = 昨天
 
   | zh-hant = 昨天
   }})
+
   }}{{#if:{{{br|}}}|)}}
  
| days-ago = {{lang
+
| days-ago = {{#if:{{{br|}}}|(}}{{lang
   | cs = (před {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} dny)
+
   | cs = před {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} dny
   | de = (vor {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} Tagen)
+
   | de = vor {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} Tagen
   | en = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|day|days}} ago)
+
   | en = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|day|days}} ago
   | es = (Hace {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|día|días}})
+
   | es = Hace {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|día|días}}
   | fi = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|päivä|päivää}} sitten)
+
   | fi = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|päivä|päivää}} sitten
   | fr = (Il y a {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|jour|jours}})
+
   | fr = Il y a {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|jour|jours}}
   | hu = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} nappal ezelőtt)
+
   | hu = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} nappal ezelőtt
   | it = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|giorno|giorni}} fa)
+
   | it = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|giorno|giorni}} fa
   | ja = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}日前)
+
   | ja = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}日前
   | ko = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}일 전)
+
   | ko = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}일 전
   | nl = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dagen}} geleden)
+
   | nl = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dagen}} geleden
   | no = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dager}} siden)
+
   | no = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dager}} siden
   | pt = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dia|dias}} atrás)
+
   | pt = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dia|dias}} atrás
   | pt-br = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dia|dias}} atrás)
+
   | pt-br = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dia|dias}} atrás
   | pl = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} dni temu)
+
   | pl = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} dni temu
   | ro = (acum {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} zile)
+
   | ro = acum {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} zile
   | ru = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{Plural|lang=ru|{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|день|дня|дней}} назад)
+
   | ru = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{Plural|lang=ru|{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|день|дня|дней}} назад
   | sv = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dagar}} sedan)
+
   | sv = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dagar}} sedan
   | zh-hans = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}日前)
+
   | zh-hans = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}日前
   | zh-hant = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}天前)
+
   | zh-hant = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}天前
   }}
+
   }}{{#if:{{{br|}}}|)}}
  
 
}}</includeonly><noinclude>
 
}}</includeonly><noinclude>
Line 79: Line 80:
 
== Usage ==
 
== Usage ==
 
* {{tlx|Days ago|2010|12|8}} (yyyy-m-d) generates {{Days ago|2010|12|8}}
 
* {{tlx|Days ago|2010|12|8}} (yyyy-m-d) generates {{Days ago|2010|12|8}}
 +
* {{tlx|Days ago|2010|12|8|5=br=yes}} (yyyy-m-d) generates {{Days ago|2010|12|8|br=yes}}
  
 
[[Category:Language templates|Days ago]]
 
[[Category:Language templates|Days ago]]
 
</noinclude>
 
</noinclude>

Revision as of 10:01, 30 January 2011

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|2010|12|8}} (yyyy-m-d) generates 5100 days ago
  • {{Days ago|2010|12|8|br=yes}} (yyyy-m-d) generates (5100 days ago)