From DoomWiki.org

m
m
Line 1: Line 1:
{{#ifexpr:{{#time:U}}>={{#time:U|{{{time|}}}}}
+
<!-- From TheOKs Wiki http://www.theoks.net/wiki/Template:Time_ago/core -->{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/{{#switch:{{#ifexpr:{{{min_magnitude_num|-1}}}>{{{auto_magnitude_num}}}
|{{#switch:{{max|{{{min_magnitude_num|-1}}}|{{{auto_magnitude_num|0}}}}}
+
  |{{{min_magnitude_num}}}
|0 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))}}|second|seconds}}
+
  |{{{auto_magnitude_num|0}}}
  |1 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/60)}}|minute|minutes}}
+
}}
  |2 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/3600)}}|hour|hours}}
+
|0 = 1
  |3 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/86400)}}|day|days}}
+
  |1 = 60
  |4 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/604800)}}|week|weeks}}
+
  |2 = 3600
  |5 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/2678400)}}|month|months}}
+
  |3 = 86400
  |6 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/31557600)}}|year|years}}
+
  |4 = 604800
}} {{{ago|ago}}}
+
  |5 = 2678400
|{{#switch:{{max|{{{min_magnitude_num|-1}}}|{{{auto_magnitude_num|0}}}}}
+
  |6 = 31557600
  |0 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))}}|second's|seconds'}}
+
|#default=1
  |1 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/60)}}|minute's|minutes'}}
+
}})}} {{#switch:{{#ifexpr:{{{min_magnitude_num|-1}}}>{{{auto_magnitude_num|0}}}
  |2 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/3600)}}|hour's|hours'}}
+
  |{{{min_magnitude_num}}}
  |3 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/86400)}}|day's|days'}}
+
  |{{{auto_magnitude_num|0}}}
  |4 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/604800)}}|week's|weeks'}}
+
}}
  |5 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/2678400)}}|month's|months'}}
+
  |0 = {{PLURAL:{{#expr:floor(abs{{#time:U}}-{{#time:U|{{{time|}}}}}}})|second|seconds}}
  |6 = {{Plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/31557600)}}|year's|years'}}
+
  |1 = {{PLURAL:{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))/60}}|minute|minutes}}
}} time
+
  |2 = {{PLURAL:{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))/3600}}|hour|hours}}
 +
  |3 = {{PLURAL:{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))/86400}}|day|days}}
 +
  |4 = {{PLURAL:{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))/604800}}|week|weeks}}
 +
  |5 = {{PLURAL:{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))/2678400}}|month|months}}
 +
  |6 = {{PLURAL:{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))/31557600}}|year|years}}
 +
}}{{#ifexpr:{{#time:U}}-{{#time:U|{{{time|}}}}}>=0
 +
|&#32;ago
 +
|' time
 
}}
 
}}

Revision as of 03:26, 18 June 2012

0 seconds ago