Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
defaultOptions = {
precision: 100, // 0.1 seconds, used to update the DOM
elapse: false,
defer: false
defer: false,
getNow: function() { return new Date(); }
};
// Miliseconds
matchers.push(/^[0-9]*$/.source);
Expand Down Expand Up @@ -212,7 +213,7 @@
this.remove();
return;
}
var now = new Date(),
var now = this.options.getNow(),
newTotalSecsLeft;
// Create an offset date object
newTotalSecsLeft = this.finalDate.getTime() - now.getTime(); // Millisecs
Expand Down