diff options
Diffstat (limited to 'assets/js/lustiges-script.js')
-rw-r--r-- | assets/js/lustiges-script.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index e886134..7ec3c6f 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -539,3 +539,23 @@ $(function() { $(this).select(); }); }); + +// closed-countdown +$(function() { + var + $el = $('.closed .countdown'), + dt = moment($el.data('dt')); + + $el.attr('title', 'on '+dt.format('dddd, MMM Do YYYY')) + function update() { + setTimeout(update, 5000); + + var now = moment('2015-03-31'); + + if(dt.dayOfYear() == now.dayOfYear() && dt.year() == now.year()) + $el.text('today'); + else + $el.text( dt.from(now) ); + } + update(); +}); |