Very similar to the legacy example, but uses the callback style instead. Format the output with blank-padded value for weeks (%-w
) and days (%-d
) and pluralize it’s output with %!w
and %!d
.
This plugin will be available in ...
HTML:
<div id="clock"></div>
JS:
$('#clock').countdown('2020/10/10').on('update.countdown', function(event) {
var $this = $(this).html(event.strftime(''
+ '<span>%-w</span> week%!w '
+ '<span>%-d</span> day%!d '
+ '<span>%H</span> hr '
+ '<span>%M</span> min '
+ '<span>%S</span> sec'));
});