Difference between revisions of "Template:StaticMeetingCountdown"

From Free Software Directory
Jump to: navigation, search
m (-leading nbsp.)
(simple English)
Line 27: Line 27:
 
       {{#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 }}) / 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
 
       |{{#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!
+
       |The meeting will start within an hour.
 
     }}
 
     }}
 
   |past today's meeting start time
 
   |past today's meeting start time
 
   }}
 
   }}
 
}}
 
}}

Revision as of 12:03, 3 April 2020

Static countdown for weekly meetings.
Stages, based on the amount of Time before the next weekly meeting:

  1. T > 1 day: show the number of remaining days;
  2. T < 1 day: show the number of remaining hours;
  3. T < 1 hour: announce the meeting is imminent;
  4. T < 1 second: announce the meeting is already active;
  5. Next morning: restart the cycle.

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.
Instructions ("parameter=default:type := definition"):

  • day_name=Friday:string  := day of the week in extended format. Case-sensitive: always start with a capital letter;
  • start_hour_time=12:integer := hour of the day. Use UTC;
  • corr_hours=5:integer := server time zone compensation in hours.

I also maintain the relative pseudo-code.
Contact me in case of technical problems. --LorenzoAncora (talk)


4 days until next meeting



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.