How to create a countdown counter between two dates

Hi I am trying to create a countdown counter that works out the number of days between two specific dates.


The idea is that the user will have booked an exam date sometime in the future. They enter date in the calculator and it works out the number of study days they have left between now and the exam date they entered. If possible it would be great if the countdown clock is active every time the user re-opens the module, so its works out a new number of days based on the new date and the existing exam date.


I have found some javascript that works out the number of days between two dates but there are 2 issues with it

1. It's in American date format mm/dd/yy and I need it in UK format dd/mm/yy

2. It doesn't pick up todays date, so every time the user re-enters the module they have to re-enter todays date to get the new countdown number.


Any ideas of possible javascipt snippets to acheive this, or how I could do this in Lectora?


Thanks

Discussions have been disabled for this post