diff options
author | MaZderMind | 2015-04-30 13:07:38 +0200 |
---|---|---|
committer | MaZderMind | 2015-04-30 13:07:38 +0200 |
commit | 91a548285cca3e1eac5947ac6101ad5c4c56b391 (patch) | |
tree | 2f99cc6874f90be11ae35c09ad7a5f59319637c3 /assets/js/lustiges-script.js | |
parent | 88fa2b84ef7664ba8ae2741a8b83dd6d1ad9d2bc (diff) |
Countdown in closed-View
Diffstat (limited to '')
-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(); +}); |