Template:Time ago: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Plastikspork
add suffix feature
Ookami (talk | contribs)
m 29 revisions imported
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{#iferror: {{#time:U| {{{1|}}} }}
{{#invoke:Time ago|main}}<noinclude>
|{{error|Error: first parameter cannot be parsed as a date or time.}}
|{{Time ago/core
  |suffix = {{#ifeq:{{{suffix|Ω}}}|Ω|ago|{{{suffix}}}}}
  |time = {{{1|}}}
  |auto_magnitude_num = {{#if:{{{magnitude|}}}
  |0<!-- Make sure the specified {{{magnitude}}} is used -->
  |{{#expr:{{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 120      ) | 1 | 0 }}+
    {{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 7200    ) | 1 | 0 }}+
    {{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 172800  ) | 1 | 0 }}+
    {{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 5356800  ) | 2 | 0 }}+
    {{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 63115200 ) | 1 | 0 }}
  }}
  }}
  |min_magnitude_num = {{#switch:{{#if:{{{magnitude|}}}
    |{{{magnitude}}}
    |{{{min_magnitude}}}
  }}
  |years  = 6
  |months  = 5
  |weeks  = 4
  |days    = 3
  |hours  = 2
  |minutes = 1
  |seconds
  |#default= 0
  }}
}}
}}<noinclude>
{{documentation}}
{{documentation}}
<!-- Categories go in the /doc subpage and interwikis go in Wikidata. -->
</noinclude>
</noinclude>

Latest revision as of 23:06, 3 September 2020

0 seconds ago