टेम्पलेट:Time ago: रिवीजन सभ के बीचा में अंतर
Content deleted Content added
imported>MSGJ support for "magnitude" parameter, per discussion |
imported>MSGJ recode, and support for min_magnitude parameter |
||
लाइन 1:
{{#iferror: {{#time:U| {{{1|}}} }}
|{{error|Error: first parameter cannot be parsed as a date or time.}}
|{{Time ago/core
|{{#if: {{{magnitude|}}}▼
|{{#expr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / {{#switch:{{{magnitude}}}▼
|auto_magnitude_num = {{#if:{{{magnitude|}}}
|minutes = 60▼
|0<!-- Make sure the specified {{{magnitude}}} is used -->
|hours = 3600▼
|{{#expr:{{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 120 ) | 1 | 0 }}+▼
|days = 86400▼
{{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 7200 ) | 1 | 0 }}+▼
|weeks = 604800▼
{{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 172800 ) | 1 | 0 }}+▼
|months = 2678400▼
|years = 31557600▼
▲
|#default= 1▼
}}▼
▲ }} ) }} {{#switch:{{{magnitude}}}
▲ |years = {{{magnitude}}}
|#default= seconds▼
}}
|min_magnitude_num
▲ {{#ifexpr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 120 ) | 1 | 0 }}+
|{{{min_magnitude}}}
▲ {{#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 ) | 1 | 0 }}+
}}
▲ }}
}}
}}<noinclude>
|