Talk:Countdown

Misc
It doesn't seem to work.--  Chris  talk   blog  16:08, August 9, 2010 (UTC)

Is there a way to remove the "T minus" part of the countdown?  Neocarleen  •  Talk

Update to Code
I'd like to propose an update to the code. My modified code here determines whether it should be sigular or plural (1 second instead of 1 seconds).


 * I've added the code. Feel free to remove it if I shouldn't have.

Error
Okay, the message when the countdown isn't working is displaying. But what do I do now? 19:24, March 29, 2012 (UTC)

No more counting up!
I'd like to offer some improvement for the code. You can see my version here. It adds another where you can make a custom message to display once the countdown is finished. The timer now will not count up once the countdown has finished and this message will be displayed instead. Land Raider 20:34, July 1, 2012 (UTC)


 * I considered changing the code a while back to work this way. The version of the code I run at Casualty Wiki has been customised so it knows when an episode is on air or has finished airing. However, after some reflection and looking at how other wikis use the code, I decided not to - as some wikis actually do use countups instead of countdowns. Your idea has merit, so I will look into integrating it into version 2.

Countdown code need to be checked
The current countdown script works really slow and need to be improved. Currently the script use is also really messy so maybe we beter make an total new version for it

What code should be used (my opinion, if possible)
 January 01 2013 00:00:00

And with all options:

 until the new year...; display:ymdhms;" style="...">January 01 2013 00:00:00

--Jens Ingels (talk) 00:59, August 16, 2012 (UTC)


 * By 'script', are you referring to the html used to insert the countdown, or the JavaScript itself?
 * I agree that the current html is messy, but any change to how the html is used would mean a separate version of the JavaScript would be needed, as a lot of wikis use the current format. This would be possible, but I just want to clarify what you think should be done. I personally think the script is rather quick.
 * (edit) I see a flaw in your 'better' html. The reason the 'JavaScript disabled' text is separate... is because it needs to display when JavaScript isn't working properly. You can't use JavaScript to say there isn't any JavaScript! ;)

With the script speed I'm talking about the switch between non JavaScript and when the script is activated. Currently it takes an long time (like 1-2 seconds) te replace the alternative text to the countdown what's in my opinion really slow. The code is just an example how it could display beter, I never said it could be an working code. Couldn't there be an save cookie option or something that can speedup the loading time ones you visited the page the first time.--Jens Ingels (talk) 15:57, August 17, 2012 (UTC)


 * The script loads virtually instantly on the wikis I use it on. Either your 1-2 seconds is an over estimate, or the wiki you have it applied to has a lot of js to load. Would you mind linking me to the wiki you run the script on, and a page with a countdown so I can test?
 * The main bulk of the countdown code was developed by an old user, but from what I understand of it, it seems very efficient as it is. If you want to suggest some actual script changes then of course, feel free, as I don't know the extent of your js knowledge.

2 Questions

 * 1) Is the "JavaScript disabled" thingy really necessary?
 * 2) Why does the countdown count up after it's finished?

I added a Dutch translation btw. --


 * When the code was first written, I suspect it was more necessary than it is today. However, this is still useful to to wikis, as alternate text if for some reason the code isn't working. For example, this template counts down to the next episode of a show. if you look closely, you will see that the alternate text provides the same information, but without the live countdown: "will air on 15 December 2012 at 21:00". However, you can just not use the 'nocountdown' bit, and it will work fine.
 * This is by design. I have seen some wikis use the code to count up - not many, but enough to justify keeping the functionality in this way. The main reason I haven't changed a lot of things in this code is because of it's wide usage on other wikis. At Casualty Wiki, I ran a customised version of the code. When the countdown reaches zero, it displays a line of text instead. While this can easily be done here, it would need to be customisable on a per-countdown basis - requiring another span tag in the syntax. While this isn't a big problem, compatibility is something I have always put first when considering changes to the code.
 * I am not a very good coder. I will be the first to admit that - and it is often obvious when others look at my codes. I 'adopted' the Countdown script as I needed it to be more versatile at the time. If you think you can improve the script without breaking the compatibility, feel free to suggest changes. I've done a lot of patchwork editing on this, and I'm sure it can be streamlined.
 * Thanks for the translation.


 * The "JavaScript disabled" thing is already optional. It cannot be removed from the code of course, but if it was up to me, I'd remove it from the documentation at least. There was a time when Wikia was usable without JavaScript but that's a distant memory :)


 * If some wikis count on counting up, then it must stay, but I think other options should be provided:


 * remove the countdown
 * let it stay at zero
 * show alternate content


 * All of these can be done without breaking compatibility.


 * If you don't mind I'll write something... --


 * I've altered the documentation. Feel free to write something, but could you run it by me first in this talk page? It just helps me keep on top of everything. Cheers.


 * No problem. You've taken this addon in your care. I respect that.


 * This is a bit unorthodox, but since it's apparently possible to have more than one countdown per page I'd suggest adding the data directly to the wikitext instead of the JS code. That might be simpler...


 * So I propose to add three (optional) new attributes to the countdown span:


 * data-end &mdash; specifies how the end should be handled:
 * value: "continue" (default) &mdash; continue counting
 * value: "stop" &mdash; stop at zero
 * value: "remove" &mdash; remove the countdown
 * value: "toggle" &mdash; set another tag's display to "inline" and the countdown's to "none"
 * value: "callback" &mdash; call a JavaScript function
 * data-toggle &mdash; another inline tag to show instead (to be used with data-end="toggle")
 * data-callback &mdash; a JavaScript function to call (to be used with data-end="callback")


 * Example:


 * I hope this is sufficiently flexible without making things complicated.


 * (I've already tested it btw: The wikitext parser does not discard attributes with a "data-" prefix.)




 * This seems practical - I assume it defaults to countup if no data-end is defined?
 * I would like to see the script in action before we commit it to the dev version. There's no rush toany of this, but when/if you get a chance to code it, put on a sandbox or something so I can take a look.


 * Alright. Here's the my rewrite proposal: w:c:pecoes:Countdown.js and you can test it here: w:c:pecoes:Countdown  . If you want to test the callback, try "demo". The demo function will show an alert when the countdown ends. --  (Files have been removed)


 * Yeah, I'm perfectly happy with that. It's nice to see the script rewritten actually. I certainly would not have been able to overhaul the script like this, so thank you.


 * If you think it is ready, feel free to update the code page and documentation. Something that might be useful to add to the code though is checks to see if we need days/hours/minutes and remove the largest interval once it reaches zero. A simple delta > 0 should do. What are your thoughts?

Yeah. That's easy to do. Personally I like the leading zeros. They give the countdown more gravitas :)

I will have to add another option then. This may not be the last option request, so I'd rather use something generic like


 * I just read Jens Ingels post... he seems to want more formatting options for the output. Has that been requested a lot? Cause that would be a boatload of work :( --


 * I haven't really seen any requests similar to what Jens is describing. I think the code is fine as it is...

Suggestion: Short counter
I use a customised version of Splarka's original countdown script, with a short form of the countdown "d days, h:m:s" to save space. It would be convenient if this script had a short option. -452 18:54, March 26, 2013 (UTC)


 * I could alter the script so that it would accept a custom format function. Something like this:

Chinese localization
There should be more localization options for Chinese language.

For example, 263 days, 19 hours, 10 minutes and 14 seconds = 263天19小時10分14秒

We don't have spaces and commas between "words". Please add an option to skip those. Sammylau (talk) 20:51, April 11, 2013 (UTC)
 * This can probably be resolved my modifications discussed above about different countdown formats. Not sure if Pecoes got any further with it though.


 * Take a look at this library and tell me if it's possible to format a chinese date with it, please! --


 * I'd suggest a more "universal" way to solve this problem. Many Asian languages doesn't need these spaces and commas too.
 * Add an option in the translation part:


 * Then add more conditions into the output function:


 * Sammylau (talk) 23:33, April 11, 2013 (UTC)


 * I can see how that would work, yes. That's certainly a good suggestion, but it's less universal than the library I suggested above. With that library everybody could format the time how he/she sees fit for their wiki. Check out the request by 452 above as an example. He apparently wants even more flexibility than your suggestion can provide. Now, if I knew he'd be the last one to make such a request, I'd say "I'm terribly sorry, but I cannot accommodate absolutely everybody" and leave it at that. But chances are, he's just the first one to make such a request...


 * Since you obviously have some programming skill, I'd be grateful, if you could take a quick look at that library and tell me, if it's possible to properly format a chinese date with it! --

Simply, yes. The library should fix everything. A little hold back for me is that is you need to explain that in depth to let people know how to format it properly. Sammylau (talk) 07:05, April 12, 2013 (UTC)


 * Yes, I agree. The explanations over there are far too short. It needs more detail. Thanks for testing it though! I'll convert the code. --

Customization
Is it possible to customize the countdown so that you can use the span tags under specific parts? Sort of like  being big and in bold, and the rest are smaller, in italics. Maybe even the option to use D:H:M:S, too. I want to do it but I really don't know how I would be able to pull it off. Is it possible, then? Masatoshino (talk) 16:51, April 29, 2013 (UTC)

Putting it in a template
Hi there... I'm trying to put your code into a template so that I can use it on a page like this:. For some reason, I can't get it to work properly =( If/When you have time, would you mind having a look for me please. Much appreciated http://img255.imageshack.us/img255/6670/squirrel3kk9.gif Wolbee 12:15, July 2, 2013 (UTC)

Can someone help me?
Can someone tell me what code I would use to add months and years to my count down timers?

HurricaneTeen6900 (talk) 21:50, August 11, 2013 (UTC)HurricaneTeen6900HurricaneTeen6900 (talk) 21:50, August 11, 2013 (UTC)

ISSUE: Using the countdown timer as a count up timer
Greeting everyone, I have an issue with the countdown timer in a page of my wiki. I've been using the coundown timer template as a "count up timer", because of the lack of a code for it (and my poor knowledge of programming). [Watch here a view from Google Chrome] The problem is that, in some dates, it appears "FECHA ERRÓNEA" (WRONG DATE). Here is the JS of the countdown. --See ya': http://images1.wikia.nocookie.net/__cb20110901220935/codesah/images/a/ad/Ajente02_Firma.JPG 22:42, September 12, 2013 (UTC)

div Tag Limits Functionality
For a while I was frustrated with the options, such as no-leading-zeros and the various data-end settings not working, and it turned out that the  tag I was using to change the font size is what caused the problem. I just wanted to point out that putting the countdown inside  tags creates such problems, in case anyone else has the issue. --Kelerik (talk) 17:06, January 27, 2014 (UTC)

Support Countdown on wikia mobile display
hi,

would it be possible to make the countdown behave properly on mobile browsers (i.e. in chrome on andriod, the countdown isn't displayed properly). Rlsf (talk) 06:53, March 3, 2014 (UTC)
 * JavaScript is not loaded in the mobile skin (unless you use some hack for it).~Ultimate Supreme  08:44, March 3, 2014 (UTC)

Malay countdown display
Can you put countdown display for Malay? (code:ms) ms: { and: 'dan', second: 'saat', seconds: 'saat', minute: 'minit', minutes: 'minit', hour: 'jam', hours: 'jam', day: 'hari', days: 'hari' }  SNN95 |Talk to me beybeh! 02:25, March 5, 2014 (UTC)