countdown.js 1011 B

1234567891011121314151617
  1. $('[data-countdown]').each(function () {
  2. var $this = $(this),
  3. finalDate = $(this).data('countdown');
  4. if (!$this.hasClass('countdown-full-format')) {
  5. $this.countdown(finalDate, function (event) {
  6. $this.html(event.strftime('<span class="countdown-time"><span>%D</span><small>days</small></span> <span class="countdown-time"><span>%H</span><small>hours</small></span> <span class="countdown-time"><span>%M</span><small>minutes</small></span> <span class="countdown-time"><span>%S</span><small>seconds</small></span>'));
  7. });
  8. } else {
  9. $this.countdown(finalDate, function (event) {
  10. $this.html(event.strftime('<span class="countdown-time"><span>%D</span><small>days</small></span> <span class="countdown-time"><span>%H</span><small>hours</small></span> <span class="countdown-time"><span>%M</span><small>minutes</small></span> <span class="countdown-time"><span>%S</span><small>seconds</small></span>'));
  11. });
  12. }
  13. });