« Modèle:Time ago » : différence entre les versions

De TI-Planet Wiki
Aller à la navigation Aller à la recherche
(Page créée avec « {{#iferror: {{#time:U| {{{1|}}} }} |{{error|Error: first parameter cannot be parsed as a date or time.}} |{{Time ago/core |ago = {{{ago|ago}}} |time = {{{1|}}} |au... »)
 
Aucun résumé des modifications
 
Ligne 1 : Ligne 1 :
{{#iferror: {{#time:U| {{{1|}}} }}
{{#iferror: {{#time:U| {{{1|}}} }} |{{error|Erreur: le premier paramètre ne peut être analysé comme une date ou une durée.}} |{{Time ago/core |ago = {{{il y a|il y a}}} |time = {{{1|}}} |auto_magnitude_num = {{#if:{{{magnitude|}}}   |0<!-- S'assurer que la {{{magnitude}}} spécifiée est bien utilisée -->   |{{#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}}</noinclude>
|{{error|Error: first parameter cannot be parsed as a date or time.}}
|{{Time ago/core
  |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|&#32;<span class="plainlinks">([{{fullurl:{{FULLPAGENAME}}|action=purge}} purge])</span>|}}<noinclude>{{documentation}}</noinclude>

Dernière version du 24 avril 2013 à 12:54

il y a 0 seconde

[create] Documentation icon Template documentation