From Free Software Directory
|
|
(11 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | <noinclude>
| + | {{#ifexpr:{{Template:StaticMeetingCountdown/isMeetingDay|day_name={{{day_name|Friday}}}|start_hour_time={{{start_hour_time|12}}}}} |
− | Static countdown for weekly meetings.<br>
| + | |—— {{#ifexpr:{{Template:StaticMeetingCountdown/meetingRemDays|day_name={{{day_name|Friday}}}|start_hour_time={{{start_hour_time|12}}}}} <= 2|meeting is tomorrow|{{Template:StaticMeetingCountdown/meetingRemDays|day_name={{{day_name|Friday}}}|start_hour_time={{{start_hour_time|12}}}}} days until next meeting}} |
− | Stages, based on the amount of <b>T</b>ime before the next weekly meeting:
| + | |{{#ifexpr:{{Template:StaticMeetingCountdown/meetingPastHour|day_name={{{day_name|Friday}}}|start_hour_time={{{start_hour_time|12}}}}} > 0||—— today's meeting ended}} |
− | <ol>
| |
− | <li><b>T</b> > 1 day: show the number of remaining days;</li>
| |
− | <li><b>T</b> < 1 day: show the number of remaining hours;</li>
| |
− | <li><b>T</b> < 1 hour: announce the meeting is imminent;</li>
| |
− | <li><b>T</b> < 1 second: announce the meeting is already active;</li>
| |
− | <li>Next morning: restart the cycle.</li>
| |
− | </ol>
| |
− | Without parameters (and here), the template shows an example countdown. The accuracy of the calculations depends on the local instance of MediaWiki and from network caching.<br>
| |
− | Instructions ("parameter=default:type := definition"):
| |
− | <ul>
| |
− | <li><b>day_name</b>=<i>Friday:string</i> := day of the week in extended format. Case-sensitive: always start with a capital letter;</li>
| |
− | <li><b>start_hour_time</b>=<i>12:integer</i> := hour of the day. Use UTC;</li>
| |
− | <li><b>corr_hours</b>=<i>5:integer</i> := server time zone compensation in hours.</li>
| |
− | </ul>
| |
− | I also maintain the relative [[Template:StaticMeetingCountdown/Pseudocode|pseudo-code]].<br>
| |
− | Contact me in case of technical problems. --[[User:LorenzoAncora|LorenzoAncora]] ([[User talk:LorenzoAncora|talk]])
| |
− | <hr>
| |
− | </noinclude>{{#ifexpr:
| |
− | {{#expr: {{#time: U | next {{{day_name|Friday}}} + {{{start_hour_time|12}}} hours }} - {{#time: U | now }} }} > 3599 and {{#ifeq: {{CURRENTDAYNAME}} | {{{day_name|Friday}}} | 0 | 1}}
| |
− | |{{#expr: ceil (({{#time: U | next {{{day_name|Friday}}} + {{{start_hour_time|12}}} hours }} - {{#time: U | now }}) / 86400) }} days until next meeting | |
− | |{{#ifexpr: | |
− | {{#expr: (({{#time: U | today + {{{start_hour_time|12}}} hours + {{{corr_hours|5}}} hours }} - {{#time: U | now }}) / 60)}} > 0
| |
− | |{{#ifexpr:
| |
− | {{#expr: (({{#time: U | today + {{{start_hour_time|12}}} hours + {{{corr_hours|5}}} hours }} - {{#time: U | now }}) / 60)}} > 3600
| |
− | |{{#expr: (({{#time: U | today + {{{start_hour_time|12}}} hours + {{{corr_hours|5}}} hours }} - {{#time: U | now }} ) / 3600) round 1}} hours until next meeting
| |
− | |the meeting is imminent, join the channel now!
| |
− | }}
| |
− | |past today's meeting start time
| |
− | }}
| |
| }} | | }} |
Latest revision as of 07:57, 1 May 2020
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the page “GNU Free
Documentation License”.
The copyright and license notices on this page only apply to the
text on this page. Any software or copyright-licenses or other
similar notices described in this text has its own copyright notice
and license, which can usually be found in the distribution or license
text itself.