finished event is not correct,early 2 seconds.
This problem is caused because the following code
secondsLeft = Math.floor((toDate.valueOf() - currentDate.valueOf()) / 1000);
Should be modified to the following code
secondsLeft = Math.ceil((toDate.valueOf() - currentDate.valueOf()) / 1000);