I'm interested to use this on the sister Wikivoyage project.
The values only appear to update whenever the host article using the template is edited.
Is there anyway to have the values refresh at least once a day? Andrewssi2 (talk) 23:17, 1 April 2015 (UTC)
The 'East Coast Belly Dance Cruise' countdown in the template's documentation page is timed from a start date: |year=2016
, |month=12
, |day=12
. Without a start time, it seems to me that countdown hours, minutes, and seconds are unknown and so should not be part of the rendered display.
I have modified a sandbox version of the module so that the display precision is more (I think) appropriate:
((countdown/sandbox |year=2016 |month=12 |day=12))
((countdown/sandbox |year=2016 |month=12 |day=12 |hour=12))
((countdown/sandbox |year=2016 |month=12 |day=12 |hour=12 |minute=30))
((countdown/sandbox |year=2016 |month=12 |day=12 |hour=12 |minute=30 |second=7))
While this change is also applied to the post-event call to formatMessage()
, that section of the code needs additional work because of the undocumented parameters it uses and to make sure it does the right thing when those parameters aren't set in the template.
—Trappist the monk (talk) 15:38, 11 April 2015 (UTC)
((U|Technical 13)) (e • t • c)
16:07, 11 April 2015 (UTC)((countdown/sandbox |year=((#time:Y|tomorrow)) |month=((#time:n|tomorrow)) |day=((#time:j|tomorrow)) |hour= |minute= |second=))
os.time()
uses 12 hours as the default if |hour=
is not specified.lang:formatDuration ()
understand 'months'
as an output option? How many people measure time in more than a few weeks before shifting to months?((U|Technical 13)) (e • t • c)
19:09, 11 April 2015 (UTC)((countdown/sandbox2))
and is now ((countdown-ymd/sandbox))
. Further discussion should take place at that template's talk page—Trappist the monk (talk) 15:28, 28 April 2015 (UTC)Extended content
|
---|
Yesterday I hacked a version of I think that this code works. In the following examples, the countdowns are listed in live, sandbox, and sandbox2 order. Countdown to tomorrow at 18:00:00
Countdown to 2024-12-12 at 18:00:00
Countdown to 2025-06-12 at 18:00:00
Notice the difference in the displayed times. You should be able to add the time this page was last refreshed to the countdown time and arrive at a sum of 18:00:00. I'm beginning to think that maybe there is a problem with As you can see, I changed the default text to be less wordy. —Trappist the monk (talk) 12:55, 13 April 2015 (UTC) I've added
—Trappist the monk (talk) 00:41, 14 April 2015 (UTC)
adjacent text[edit]It seems to me that editors should have more flexibility when it comes to the text surrounding the countdown. So I invented some parameters:
And some examples:
Further, because this version of —Trappist the monk (talk) 13:33, 27 April 2015 (UTC) |
I noticed that simple usage like ((countdown|year=2015|month=1|day=1))
(date is in the past) gave "Lua error: bad argument #1 to 'ucfirst' (string expected, got nil)." I fixed that with some adjustment of the parentheses. Some other problems of the same nature still exist but I couldn't work out exactly what was wanted from the code so I left it for now. At any rate, when an event is in progress, the module attempts to show something like "There are 2 days until the event ends". However, that never happens because of a precedence problem which needs some parentheses to fix. I would have fixed it but I can't see why "or
" was used at all and my thinking time has ended for now. The following shows that an "in progress event" does not currently display when it ends. This uses fixed wikitext so it won't change if the module is updated.
((countdown|year=2015|month=1|day=1|duration=365|duration unit=day|eventstart=EVENT START|eventend=EVENT END))
→EVENT START (refresh)
Johnuniq (talk) 03:50, 18 November 2015 (UTC)
This would be useful when it's used in other templates with another refresh/purge button already present. Maybe User:Johnuniq can help here? Headbomb {t · c · p · b} 15:03, 1 April 2019 (UTC)
|refresh=no
. The following demonstrates both. At the time I am posting this, the event is in progress and that did not work before.
((countdown|year=2019|month=3|day=1|duration=200|duration unit=day))
→ The event has ended. (refresh)((countdown|year=2019|month=3|day=1|duration=200|duration unit=day|refresh=no))
→ The event has ended.Hi there I wanted to add to the Climate Clock countdown also the CO2-budget countdown, but I wouldnt know if there is a way to do a countdown that reduces the remaining CO2-budget with every update, instead of years/days/hours/minutes/seconds. But you would need to be able to define an amount of reduction per time unit. Something like the bottom countdown at this site: https://www.mcc-berlin.net/fileadmin/data/clock/carbon_clock.htm Nsae Comp
Does anyone know a way?
(talk) 08:23, 29 April 2023 (UTC)