Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xto3na/bc88a1ff2e4a64f1872e to your computer and use it in GitHub Desktop.
Save xto3na/bc88a1ff2e4a64f1872e to your computer and use it in GitHub Desktop.
Цикличный обратный отсчет на JS
/******************** Обратный отсчет *************************/
var month = new Date().getMonth() + 1;
if (month == 0) {month++;};
console.log(month);
var currentDate = new Date();
var futureDate = new Date(2015, month, 1);
var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000;
/*var diff = 3600 * 24 * 20.17535;*/
var clock = $('#my-clock').FlipClock(diff, {
autoStart: true,
clockFace: 'DailyCounter',
countdown: true,
language:'ru-ru'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment