Template talk:Day Countdown

Countdown template?
I see a countdown template used on the Chinese Wikvoyage here, counting the days to the start of the Tokyo 2020 Olympics. Is there any similar template on the English Wikivoyage? Thanks! Nicolas1981 (talk) 03:00, 30 March 2015 (UTC)


 * Just copy and create this page on English Wikivoyage: https://zh.wikivoyage.org/wiki/Template:Day_Countdown
 * Translation would be nice bonus ^-^ --Andrewssi2 (talk) 04:02, 30 March 2015 (UTC)


 * I made a first cut. I need to wait for some timer job in the background before some of the text refreshes into English:
 * --Andrewssi2 (talk) 05:21, 30 March 2015 (UTC)
 * --Andrewssi2 (talk) 05:21, 30 March 2015 (UTC)


 * Wonderful! :-) Nicolas1981 (talk) 02:00, 1 April 2015 (UTC)


 * Not quite finished yet! Although the original Chinese creator has taken a look. (It is also still experimental in the Chinese version) Andrewssi2 (talk) 03:18, 1 April 2015 (UTC)


 * There is a problem with the template... it appears to only update the value whenever the page hosting it is edited. Does anyone know how to either make it run dynamically or at least refresh every day?
 * If not, then using Javascript is probably the way to go, but I'd prefer to avoid that. Andrewssi2 (talk) 22:21, 1 April 2015 (UTC)
 * I think you can do it with ParserFunctions, but you'll have to figure it out. --Saqib (talk) 22:42, 1 April 2015 (UTC)
 * You might play (test) beta Lua Module:Countdown .. http://en.wikipedia.org/wiki/Module:Countdown - Matroc (talk) 22:49, 1 April 2015 (UTC)
 * I just looked at w:Template:Countdown that uses Lua. It doesn't seems to automatically update either... Andrewssi2 (talk) 23:01, 1 April 2015 (UTC)
 * Yes you are correct! One has to refresh page to get it to change ... I should have remembered that from 2 or so years ago from a test I did with getting system time and date. I came back to add that to note as well... - Matroc (talk) 23:24, 1 April 2015 (UTC)
 * Edited or purged. You need a bot to do automatic purging though. --Zhuyifei1999 (talk) 10:13, 2 April 2015 (UTC)


 * Not sure about this. If the person using this template also needs to set up a bot then that sounds like too much configuration. --Andrewssi2 (talk) 22:28, 2 April 2015 (UTC)


 * If it is too much work, don't worry, your time is probably best spent elsewhere :-) Cheers! Nicolas1981 (talk) 02:49, 6 April 2015 (UTC)


 * Actually, it is not much work. The problem is that every time someone wants to use the template they need to set up a corresponding bot at the same time!
 * Does anyone know if a Bot can be created that updates every article with an instance of this Template? Andrewssi2 (talk) 06:30, 6 April 2015 (UTC)
 * It could be done with AWB quite easily, but someone would still have to manually run it every day. I'm sure you could also write a script that runs automatically every day to do it too, but I don't know how to do that. Texugo (talk) 10:58, 6 April 2015 (UTC)

Status
I thought fair to make it clear that as of May 2015 this template is not working. It will only update the time left whenever the hosting page is edited, so if the hosting page is not changed for 50 days then the template will be wrong for all of those 50 days.

Solutions include:


 * 1) Writing a bot to 'refresh' every page hosting this template once a day
 * 2) Writing Javascript so that the value is dynamically computed on the client browser

Both are feasible solutions, but neither is elegant enough (I feel) for Wikivoyage, so I will therefore leave for now. Anyone else is more than welcome to pick this up should they wish. --Andrewssi2 (talk) 23:52, 17 May 2015 (UTC)

Error
I copy and paste this template to vi:Bản mẫu:Đếm ngược ngày and translate some parameters, but in article Tokyo 2020 has error "Lỗi biểu thức: Dư toán tử <" (Expression error: Operator remainder <). Even though I tried everything, it didn't fix the error. What is this error and how to fix it? Flyplanevn27 (talk) 14:09, 29 August 2021 (UTC)