Skip to content

Instantly share code, notes, and snippets.

@JayGreentree
Created July 25, 2020 22:15
Show Gist options
  • Save JayGreentree/bd81bc25a943f73e44d1cd99f010724e to your computer and use it in GitHub Desktop.
Save JayGreentree/bd81bc25a943f73e44d1cd99f010724e to your computer and use it in GitHub Desktop.
{%- assign scheduleid = 240 -%}
<script type="text/javascript">
$(function () {
var holiday = new Date();
holiday = new Date("{[ scheduledcontent schedulecategoryid:'{{scheduleid}}' showwhen:'notlive' ]}{{ NextOccurrenceDateTime | Date: 'yyyy/MM/dd HH:mm:ss' }}{[ endscheduledcontent ]}{[ scheduledcontent schedulecategoryid:'{{scheduleid}}' showwhen:'live' ]}islive{[ endscheduledcontent ]}");
$('#expireMessage').countdown({until: shortly,
expiryText: '<div class="over">It\'s all over</div>'});
$('#expireMessageStart').click(function() {
shortly = new Date();
shortly.setSeconds(shortly.getSeconds() + 5.5);
$('#expireMessage').countdown('option', {until: shortly});
});
$('#year').text(holiday.getFullYear());
});
</script>
<h1>Next Service begins in:</h1> <div id="expireMessage"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment