Jump to content

Template:Auto-outdated: Difference between revisions

simplified equations using different magic words
(added another level to switch function to allow for a two year gap between the current and revision dates)
(simplified equations using different magic words)
Line 11: Line 11:
{{#ifexpr:14>
{{#ifexpr:14>
{{#switch:
{{#switch:
{{#expr:{{#expr:trunc{{#expr:{{CURRENTTIMESTAMP}}*0.0000000001}}}} - {{#expr:trunc{{#expr:{{REVISIONTIMESTAMP}}*0.0000000001}}}}}}
{{#expr:{{CURRENTYEAR}} - {{REVISIONYEAR}}}}
|0={{#expr:{{#time:z|{{#expr:trunc{{#expr:{{CURRENTTIMESTAMP}}*0.000001}}}}}}-{{#time:z|{{#expr:trunc{{#expr:{{REVISIONTIMESTAMP}}*0.000001}}}}}}}}
|0={{#expr:{{#time:z|{{CURRENTTIMESTAMP}}}}-{{#time:z|{{REVISIONTIMESTAMP}}}}}}
|1={{#expr:365-{{#time:z|{{#expr:trunc{{#expr:{{REVISIONTIMESTAMP}}*0.000001}}}}}}+
|1={{#expr:365-{{#time:z|{{REVISIONTIMESTAMP}}}}+
{{#time:z|{{#expr:trunc{{#expr:{{CURRENTTIMESTAMP}}*0.000001}}}}}}}}
{{#time:z|{{CURRENTTIMESTAMP}}}}}}
|2={{#expr:365 + 365-{{#time:z|{{#expr:trunc{{#expr:{{REVISIONTIMESTAMP}}*0.000001}}}}}}+
|2={{#expr:730-{{#time:z|{{REVISIONTIMESTAMP}}}}+
{{#time:z|{{#expr:trunc{{#expr:{{CURRENTTIMESTAMP}}*0.000001}}}}}}}}
{{#time:z|{{CURRENTTIMESTAMP}}}}}}|error1}}|yes|no}}
|error1}}|yes|no}}
|yes=OKAY|no=Expired [[Category:Auto-outdated]]|error2}}'''</font></div>
|yes=OKAY|no=Expired [[Category:Auto-outdated]]|error2}}'''</font></div>
|-
|-
3,970

edits