A simple counter that counts how much time remains/passed from a spcified date and time. The class was inspired by a joomla pugin called util_counter, which can be found here
<div id='res'></div>
Then the JS:
var counter = new SimpleCounter('res',new Date(2011,12,1));
The class identifies 4 letters: D(days), H(hours), M(minutes), S(seconds) surounded by curly bracets. If the letters are capital, the unit's name will be used allongside the unit's number. Else, if a smal letter is used, only the unit's number will be used.
Examples:
'{D} {h}:{m}:{s}' // 14 Days 10:34:15 '{D}, {H} and {M}' // 14 Days, 10 Hours and 34 Minutes
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus