Editing Template:ExpiringSoon
From Fallen London Wiki
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
<!-- | <!-- | ||
+ | Handle various date precisions | ||
+ | -->{{#if: {{{Year|}}}<!-- | ||
+ | -->| {{#if: {{{Month|}}}<!-- | ||
+ | -->| {{#if: {{{Day|}}}<!-- | ||
+ | Note the date parser dislikes unpadded days | ||
+ | -->| {{#vardefine:expirydate | {{#expr:{{#time:Ym|{{{Year|}}}-{{{Month|}}}}}*100 + {{{Day|}}}}}}}<!-- | ||
+ | -->{{#vardefine:displaydate | on {{#time:j F Y|{{#expr:{{#time:Ym|{{{Year|}}}-{{{Month|}}}}}*100 + {{{Day|}}}}}}}}}<!-- | ||
+ | -->{{#vardefine:displayafter | <nowiki /> after that date}}<!-- | ||
+ | |||
+ | -->| {{#vardefine:expirydate | {{#time:Ym|{{{Year|}}}-{{{Month|}}}}}99 }}<!-- | ||
+ | -->{{#vardefine:displaydate | in {{#time:F Y|{{{Year|}}}-{{{Month|}}}}}}}<!-- | ||
+ | -->{{#vardefine:displayafter | <nowiki /> after that}}<!-- | ||
+ | -->}}<!-- | ||
+ | |||
+ | -->| {{#vardefine:expirydate | {{{Year|}}}9999 }}<!-- | ||
+ | -->{{#vardefine:displaydate | in {{{Year|}}}}}<!-- | ||
+ | -->{{#vardefine:displayafter | <nowiki /> after that}}<!-- | ||
+ | -->}}<!-- | ||
+ | -->| {{#vardefine:expirydate | 99999999 }}<!-- | ||
+ | -->{{#vardefine:displaydate | soon}}<!-- | ||
+ | -->{{#vardefine:displayafter | }}<!-- | ||
+ | -->}}<!-- | ||
Has the expiry date passed? | Has the expiry date passed? | ||
− | + | -->{{#ifexpr: {{#time:Ymd}} < {{#var:expirydate}}<!-- | |
− | -->{{#ifexpr: {{#time:Ymd}} < | + | If not, display this template |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | If not, display this template | ||
− | |||
-->|<!-- | -->|<!-- | ||
-->{{{!}} data-flw-theme="dark" style="background:#0e0e0e; color:#f7fdfa; border:2px solid #d52525;" cellpadding=8 | -->{{{!}} data-flw-theme="dark" style="background:#0e0e0e; color:#f7fdfa; border:2px solid #d52525;" cellpadding=8 | ||
{{!}}- style="vertical-align: middle;" | {{!}}- style="vertical-align: middle;" | ||
{{!}} style="min-width:50px;" {{!}} [[File:Calendar2.png|50px|link=]] | {{!}} style="min-width:50px;" {{!}} [[File:Calendar2.png|50px|link=]] | ||
− | {{!}} style="color:#d52525;" {{!}} '''''Due to forthcoming changes to Fallen London, this {{#ifeq: {{{Section|}}} | yes | section | page |}} is expected to become outdated | + | {{!}} style="color:#d52525;" {{!}} '''''Due to forthcoming changes to Fallen London, this {{#ifeq: {{{Section|}}} | yes | section | page |}} is expected to become outdated {{#var:displaydate}}. It should be used with caution{{#var:displayafter}}.'''''<!-- |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
-->{{#if: {{{Detail|}}} |<nowiki /> | -->{{#if: {{{Detail|}}} |<nowiki /> | ||
{{!}}- | {{!}}- | ||
Line 60: | Line 36: | ||
{{!}}}[[Category:Guides Expiring Soon]]<!-- | {{!}}}[[Category:Guides Expiring Soon]]<!-- | ||
− | Otherwise, delegate to [[Template:Outdated]] | + | Otherwise, delegate to [[Template:Outdated]] |
− | |||
-->| {{Outdated|Section={{{Section|}}}}} }} | -->| {{Outdated|Section={{{Section|}}}}} }} | ||
<noinclude>[[Category:Article management templates]]{{Documentation}}</noinclude> | <noinclude>[[Category:Article management templates]]{{Documentation}}</noinclude> |