"टेम्पलेट:Time ago" की अवतरण में अंतर

support for "magnitude" parameter, per discussion
imported>MSGJ
(support for "magnitude" parameter, per discussion)
{{#iferror: {{#time:U| {{{1|}}} }}
{{#switch:
|{{error|Error: first parameter cannot be parsed as a date or time.}}
{{#expr: <!--WHAT 'ORDER OF MAGNITUDE' IS THE OFFSET?-->
|{{#if: {{{magnitude|}}}
|{{#expr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / {{#switch:{{{magnitude}}}
|minutes = 60
|hours = 3600
|days = 86400
|weeks = 604800
|months = 2678400
|years = 31557600
|#default= 1
}} ) }} {{#switch:{{{magnitude}}}
|minutes
|hours
|days
|weeks
|months
|years = {{{magnitude}}}
|#default= seconds
}}
| <!-- No specific magnitude -->{{#switch:{{#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|}}} }} ) / 63115200 ) | 1 | 0 }}
}}
| |0 = {{#expr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 1 ) }} सेकंडseconds
| |1 = {{#expr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 60 ) }} मिनटminutes
| |2 = {{#expr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 3600 ) }} घंटेhours
| |3 = {{#expr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 86400 ) }} दिनdays
| |4 = {{#expr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 2678400 ) }} माहmonths
| |5 = {{#expr: floor( abs( {{#time:U}} - {{#time:U| {{{1|}}} }} ) / 31557600 ) }} वर्षyears
}}
 
}}{{#ifexpr: {{#time:U}} - {{#time:U| {{{1|}}} }} >= 0
| |&#32;पूर्वago
|' time
| ' समय
}}
}}<noinclude>
{{pp-template}}
{{documentation}}
</noinclude>
नामालूम प्रयोगकर्ता