Releases: hilios/jQuery.countdown
v2.2.0
What's new in 2.2.0?
- Total count for hours
%I
, minutes%N
, seconds%T
; - Count to weeks left to complete a month
%W
(issue #210); - Defer initialization, allow control the start of the plugin (issue #198);
- Fix pluralization bug when return is zero ( issue #187).
Deferred initialization
Allows the registration of callbacks before starting the plugin, so always renders at the initialization.
$('#clock').countdown('YYYY/MM/DD', {defer: true})
.on('update.countdown', function(event) {
$(this).html(event.strftime('%D days till end...'));
})
.countdown('update') //
.countdown('start');
Total count
Standalone usage of any time component in the formatter:
%I
hours count till end;%N
minutes count till end;%T
seconds count till end;
$('#clock').countdown('YYYY/MM/DD', function(event) {
$(this).html(event.strftime('%I hours left'));
$(this).html(event.strftime('%N minutes left'));
$(this).html(event.strftime('%T seconds left'));
});
Weeks left %W
To use in conjunction of the months %m
displays only the weeks left to complete that month:
$('#clock').countdown('YYYY/MM/DD', function(event) {
$(this).html(event.strftime('%m months and %W weeks till end...'));
});
v2.1.0
Follow the semver correctly this time, new features available since elapse
version.
What's new in 2.1.0?
- Proper offset for days left to a month and to a week;
- Fix bower (Issue #136);
daysToMonth %n
The amount of days left from a complete month:
$('#clock').countdown('YYYY/MM/DD', function(event) {
$(this).html(event.strftime('%m months and %n days till end...'));
});
daysToWeek %d
The amount of days left from a complete weeks. The old days
behaviour will be changed to match the totalDays
.
$('#clock').countdown('YYYY/MM/DD', function(event) {
$(this).html(event.strftime('%w weeks and %d days till end...'));
});
v2.0.5
What's new in 2.0.5?
- Allow precision controls through an options object;
- Allow to continue after countdown finishes;
- Don't dispatch events when nothing changes;
Continue
var fiveSecsAgo = new Date().getTime() + 5000;
$('#clock').countdown(fiveSecsAgo, {elapse: true}).on('update.countdown', function(event) {
$this = $(this);
if (event.elapsed) {
$this.html(event.strftime('%S seconds from finish!'));
} else {
$this.html(event.strftime('%S seconds till finish...'));
}
});
Control precision
// Update every second
$('#clock').countdown('YYYY/MM/DD', {precision: 1000});
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0.0
Great improvements
The 2.0.0 release is a major step forward in The Final Countdown jQuery plugin, this version introduces a new strftime
formatter that allows greater flexibility and easy of use to render the countdown.
Also a newly introduce website and documentation hosted in GitHub Page at http://hilios.github.io/jQuery.countdown/
<div id="getting-started"></div>
<script type="text/javascript">
$('#getting-started').countdown('2015/01/01', function(event) {
$(this).html(event.strftime('%w weeks %d days %H:%M:%S'));
});
</script>
What's new in 2.0.0
- Add the
strftime
formatter - Add support for jQuery callback style
- Add grunt tools
- Better docs and examples