Template:Time ago: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
m (Changed protection level of Template:Time ago: allow template editors ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))) |
(switch to Module:TimeAgo, written by User:FunPika) |
||
Line 1: | Line 1: | ||
{{#invoke:TimeAgo|main}}<noinclude> |
|||
{{#iferror: {{#time:U| {{{1|}}} }} |
|||
{{documentation}} |
|||
|{{error|Error: first parameter cannot be parsed as a date or time.}} |
|||
<!-- Categories go in the /doc subpage and interwikis go in Wikidata. --> |
|||
|{{Time ago/core |
|||
</noinclude> |
|||
|ago = {{{ago|ago}}} |
|||
|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 |
|||
}} |
|||
}} |
|||
}}{{#ifeq:{{{purge|}}}|yes| <span class="plainlinks">([{{fullurl:{{FULLPAGENAME}}|action=purge}} purge])</span>|}}<noinclude>{{documentation}}</noinclude> |