NodeGuy / server-date

Make the server's clock available in the browser.
http://www.nodeguy.com/serverdate/
Mozilla Public License 2.0
193 stars 53 forks source link

Question #38

Closed warrenkc closed 3 years ago

warrenkc commented 5 years ago

Awesome work by the way. I am trying to get my countdown timer to work with the server time. Is there a way to know when ServerDate is ready to be used? Thank you so much. Right now, it works only if I wait 3 seconds like this:

setTimeout(function () { createTimer(endDate); }, 3000);

Sample shown here: https://xpertdatetime.com/countdown/

NodeGuy commented 5 years ago

You can try setting ServerDate.amortizationThreshold = 0 to make the server's time available immediately.