Difference between revisions of "Template:ACKsessionDayOfMonth"

From Hackerspace ACKspace
Jump to: navigation, search
(Add insult to current magic: Showdate for the second to last Saturday (on odd months) or Sunday (on even months))
 
(updated magic: show next date if the current has already passed (TODO: check if timezones and/or actual date gives problems))
Line 1: Line 1:
 
<noinclude>:Shows the second to last Saturday (on odd months) or Sunday (on even months):
 
<noinclude>:Shows the second to last Saturday (on odd months) or Sunday (on even months):
:</noinclude>{{#ifexpr: {{CURRENTMONTH}} mod 2 = 1
+
:</noinclude>{{#ifexpr:
|{{NthDayOfMonth|nth=-1}}
+
{{#time: U |
|{{NthDayOfMonth|nth=-1|day=0}}
+
    {{#ifexpr: {{CURRENTMONTH}} mod 2 = 1
 +
    |{{NthDayOfMonth|nth=-1}}
 +
    |{{NthDayOfMonth|nth=-1|day=0}}
 +
    }}
 +
}}
 +
>
 +
{{#time: U | now }}
 +
| {{#ifexpr: {{CURRENTMONTH}} mod 2 = 1
 +
    |{{NthDayOfMonth|nth=-1}}
 +
    |{{NthDayOfMonth|nth=-1|day=0}}
 +
    }}
 +
| {{#ifexpr: {{#time: m|now + 4 weeks}} mod 2 = 1
 +
    |{{NthDayOfMonth|nth=-1|month={{#time: m|now + 4 weeks}}|year={{#time: Y|now + 4 weeks}}}}
 +
    |{{NthDayOfMonth|nth=-1|day=0|month={{#time: m|now + 4 weeks}}|year={{#time: Y|now + 4 weeks}}}}
 +
    }}
 
}}
 
}}

Revision as of 10:05, 26 March 2018

Shows the second to last Saturday (on odd months) or Sunday (on even months):
23-11-2024