Skip to content

Instantly share code, notes, and snippets.

@mpaccione
Created April 23, 2016 19:07
Show Gist options
  • Save mpaccione/eb4dbb09ebe1846cafe2e4e9fb4d062c to your computer and use it in GitHub Desktop.
Save mpaccione/eb4dbb09ebe1846cafe2e4e9fb4d062c to your computer and use it in GitHub Desktop.
$("#countdown").countdown("2016/08/01 12:34:56").on('update.countdown', function(event) {
var d = '%D days',
h = '%H hours',
m = '%M minutes',
s = '%S seconds';
if(event.offset.days > 0) { d = '%-d day%!d'; }
if(event.offset.hours > 0) { h = '%-h hour%!h'; }
if(event.offset.minutes > 0) { m = '%-m minute%!m'; }
if(event.offset.seconds > 0) { s = '%-s seconds%!s'; }
var format = d+" "+h+" "+m+" "+s;
$(this).html(event.strftime(format));
}).on('finish.countdown', function(event) { $(this).html('Next Datathon Date To Be Determined').parent().addClass('disabled'); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment