Difference between revisions of "Template:Time ago/core"

From Recidemia
Jump to: navigation, search
m (+category)
 
m (Changed protection level of Template:Time ago/core: Highly visible template ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
Line 1: Line 1:
{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/{{#switch:{{#ifexpr:{{{min_magnitude_num|-1}}}>{{{auto_magnitude_num}}}
+
{{#ifexpr:{{#time:U}}>={{#time:U|{{{time|}}}}}
  |{{{min_magnitude_num}}}
+
|{{#switch:{{max|{{{min_magnitude_num|-1}}}|{{{auto_magnitude_num|0}}}}}
  |{{{auto_magnitude_num|0}}}
+
|0 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))}}|second|seconds}}
}}
+
  |1 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/60)}}|minute|minutes}}
|0 = 1
+
  |2 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/3600)}}|hour|hours}}
  |1 = 60
+
  |3 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/86400)}}|day|days}}
  |2 = 3600
+
  |4 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/604800)}}|week|weeks}}
  |3 = 86400
+
  |5 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/2678400)}}|month|months}}
  |4 = 604800
+
  |6 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/31557600)}}|year|years}}
  |5 = 2678400
+
}} {{{ago|ago}}}
  |6 = 31557600
+
|{{#switch:{{max|{{{min_magnitude_num|-1}}}|{{{auto_magnitude_num|0}}}}}
|#default=1
+
  |0 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))}}|second's|seconds'}}
}})}} {{#switch:{{#ifexpr:{{{min_magnitude_num|-1}}}>{{{auto_magnitude_num|0}}}
+
  |1 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/60)}}|minute's|minutes'}}
  |{{{min_magnitude_num}}}
+
  |2 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/3600)}}|hour's|hours'}}
  |{{{auto_magnitude_num|0}}}
+
  |3 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/86400)}}|day's|days'}}
}}
+
  |4 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/604800)}}|week's|weeks'}}
  |0 = {{PLURAL:{{#expr:floor(abs{{#time:U}}-{{#time:U|{{{time|}}}}}}})|second|seconds}}
+
  |5 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/2678400)}}|month's|months'}}
  |1 = {{PLURAL:{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))/60}}|minute|minutes}}
+
  |6 = {{plural|{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}})/31557600)}}|year's|years'}}
  |2 = {{PLURAL:{{#expr:floor(abs({{#time:U}}-{{#time:U|{{{time|}}}}}))/3600}}|hour|hours}}
+
}} time
  |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
 
| ago
 
|' time
 
}}<noinclude>[[Category:Template subpages|{{PAGENAME}}]]</noinclude>
 

Revision as of 22:21, 17 June 2011

0 seconds ago