FlipClock
FlipClock copied to clipboard
Add support for weekly countdown
Fixes #198
The following code should show this off, assuming an html element with class="clock" attribute set.
$(document).ready(function () {
// Grab the current date
var currentDate = new Date();
var eventStart = new Date("Nov 30, 2015");
// Calculate the difference in seconds between the future and current date
var diff = eventStart.getTime() / 1000 - currentDate.getTime() / 1000;
// Instantiate a coutdown FlipClock
clock = $('.clock').FlipClock(diff, {
clockFace: 'WeeklyCounter',
// clockFace: 'DailyCounter',
countdown: true,
});
});
Here's what this looks like for me:
