<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.countdown-pl.js"></script>
<script type="text/javascript">
$(function () {
- var deadline = new Date(2013, 1, 15);
- $('#countdown').countdown({until: deadline});
+ var serverTime = function() {
+ var time = null;
+ $.ajax({url: 'http://wolnelektury.pl/zegar/',
+ async: false, dataType: 'text',
+ success: function(text) {
+ time = new Date(text);
+ }, error: function(http, message, exc) {
+ time = new Date();
+ }});
+ return time;
+ }
+ var deadline = new Date(2013, 1, 16);
+ $('#countdown').countdown({
+ until: deadline,
+ serverSync: serverTime
+ });
});
</script>
</body>