Template:Years since: Difference between revisions
Template page
More actions
mNo edit summary |
mNo edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<!-- Cases: | <!-- Cases: | ||
a) empty string -> {{error|}} | a) empty string -> {{error|}} | ||
| Line 5: | Line 4: | ||
c) more than max -> max | c) more than max -> max | ||
d) less than min -> min | d) less than min -> min | ||
e) number | e) number in between min and max. {{#expr: trunc( ({{CURRENTYEAR}}-{{{1}}}) / {{{mod|1}}}) * {{{mod|1}}} }} calculates number of years since {{{1}}} rounded down to a multiple of mod | ||
-->{{#switch:1 | -->{{#switch:1 | ||
|{{#if: {{{1|}}} |0|1}} = {{{error|}}} | |{{#if: {{{1|}}} |0|1}} = {{{error|}}} | ||
| Line 13: | Line 12: | ||
|#default = {{#expr: trunc( ({{CURRENTYEAR}}-({{{1}}})) / {{{mod|1}}}) * {{{mod|1}}} }} | |#default = {{#expr: trunc( ({{CURRENTYEAR}}-({{{1}}})) / {{{mod|1}}}) * {{{mod|1}}} }} | ||
}}<noinclude> | }}<noinclude> | ||
{{heavily used template}} | |||
{{Documentation}} | {{Documentation}} | ||
</noinclude> | </noinclude> | ||