Difference between revisions of "Template:IfSaturday"
From Geohashing
(add tests) |
(add {{intricate}}) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <includeonly>{{#ifexpr:{{#time:N| {{{date|{{CURRENTTIMESTAMP}}}}}}}=6|{{{1}}}|{{{2}}}}}</includeonly><noinclude> | + | <includeonly>{{#ifexpr:{{#time:N|{{{date|{{CURRENTTIMESTAMP}}}}}}}=6|{{{1}}}|{{{2}}}}}</includeonly><noinclude> |
Based on the <code>date</code> argument (or the current date if not specified), returns argument 1 if it is saturday, argument 2 otherwise. | Based on the <code>date</code> argument (or the current date if not specified), returns argument 1 if it is saturday, argument 2 otherwise. | ||
<code>{{IsSaturday|y|n}}</code> → {{IsSaturday|y|n|date=2020-03-06}} (as of this writing)<br> | <code>{{IsSaturday|y|n}}</code> → {{IsSaturday|y|n|date=2020-03-06}} (as of this writing)<br> | ||
<code>{{IsSaturday|y|n|date=2020-03-06}}</code> → {{IsSaturday|y|n|date=2020-03-06}} <br> | <code>{{IsSaturday|y|n|date=2020-03-06}}</code> → {{IsSaturday|y|n|date=2020-03-06}} <br> | ||
− | <code>{{IsSaturday|y|n|date=2020-03-07}}</code> → {{IsSaturday|y|n|date=2020-03-07}} | + | <code>{{IsSaturday|y|n|date=2020-03-07}}</code> → {{IsSaturday|y|n|date=2020-03-07}} <br> |
+ | <code>{{IsSaturday|y|n|date=aspoidmapi}}</code> → {{IsSaturday|y|n|date=aspoidmapi}} | ||
+ | |||
+ | {{intricate}} | ||
</noinclude> | </noinclude> |
Latest revision as of 21:16, 6 March 2020
Based on the date
argument (or the current date if not specified), returns argument 1 if it is saturday, argument 2 otherwise.
{{IsSaturday|y|n}}
→ n (as of this writing)
{{IsSaturday|y|n|date=2020-03-06}}
→ n
{{IsSaturday|y|n|date=2020-03-07}}
→ y
{{IsSaturday|y|n|date=aspoidmapi}}
→ Expression error: Unexpected < operator.
This template employs features of template syntax, some of which may be too intricate for novices. Please discuss any shortcomings or faults of this template on its talk page before making any changes. You are also encouraged to contact the original creator via their user page prior to editing this template. If changes are necessary, please familiarise yourself with the template’s setup and WikiMedia parser functions before attempting to edit, or contact someone with knowledge of template syntax.
If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages. |