【发布时间】:2020-05-27 15:11:35
【问题描述】:
我需要在带有时区的单个页面中使用多个倒计时。我找到了Final Countdown
我找到了我需要的代码。但无法让它在正确的时区工作。
$(function(){
$('[data-countdown]').each(function() {
var $this = $(this), finalDate = $(this).data('countdown');
$this.countdown(finalDate, function(event) {
$this.html(event.strftime('%H:%M:%S'));
});
});
});
这适用于多个倒计时,效果很好..
这是一个带有单个倒计时的时区。
var nextYear = moment.tz("2020-05-29 00:00", "America/Sao_Paulo");
$('#clock').countdown(nextYear.toDate(), function(event) {
$(this).html(event.strftime('%D days %H:%M:%S'));
});
我怎样才能让第一个工作在适当的时区.. 非常感谢
【问题讨论】:
标签: javascript jquery countdown