1
カウントダウンプラグインを使用していますが、日付と時刻を間違って設定していると思います。設定した日付をjavascriptで設定する
コード:
var clock;
$(document).ready(function() {
// Grab the current date
var currentDate = new Date();
// Set some date in the future. In this case, it's always Jan 1
var futureDate = new Date(2016,10,27, 10,00,00);
// Calculate the difference in seconds between the future and current date
var diff = futureDate.getTime()/1000 - currentDate.getTime()/1000;
// Instantiate a coutdown FlipClock
clock = $('.clock').FlipClock(diff, {
clockFace: 'DailyCounter',
countdown: true
});
});
私はこれをしようとしている:私は
何か間違ったことしなければならないのに52日をコーディング午前10時で2016年10月27日である
var futureDate = new Date(2016,10,27, 10,00,00);
JavaScriptでは、 'Date'コンストラクタの月は' 0'から始まります。したがって、10月を設定するには '10-1'を渡す必要があります。 – Satpal