jQuery.countdown icon indicating copy to clipboard operation
jQuery.countdown copied to clipboard

Timezone issue with moment.js and with client time

Open cpouldev opened this issue 8 years ago • 2 comments

After searching for hours I couldn't solve my issue. I saw your example on the plugin's website but whenever I change the machine time, the countdown changes too (on your website too!). The strange thing is that a few months ago it was working!

Here is my code

<script> var countUTC = moment.tz('<?php echo $countdownField->format(DATE_ISO8601); ?>', "Europe/Athens"); $('div#clock').countdown(countUTC.toDate()) .on('update.countdown', function(event) { $(this).html(event.strftime('<?php _e('%D days %H:%M:%S', 'sometextdomain'); ?>')); }) .on('finish.countdown', function(event) { $(this).html('Available! Refresh the page').css('font-size', '2rem'); });; </script>

Can you reproduce the issue by changing your computer's time on your website's example?

Thanks!

cpouldev avatar Oct 09 '16 22:10 cpouldev

Well I ended up doing @samgavinio solution

:)

cpouldev avatar Oct 09 '16 22:10 cpouldev

I've noticed the same problem. Will have a look at that solution...

badcom avatar Oct 24 '16 20:10 badcom