MCPcopy Create free account
hub / github.com/AyushSaini00/60minuteJavaScript / updateTimer

Function updateTimer

countdown/app.js:46–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44let countdownDate = new Date(inputElement).getTime();
45
46function updateTimer(){
47 //taking difference of present time with countdownDate
48 let dateDotNowinIST = Date.now() + 19800000; //because IST is 5:30 ahead of UCT timezone
49 let timeLeft = countdownDate - dateDotNowinIST;
50
51 getTimeInFormat(timeLeft);
52
53 if(timeLeft < 0 ){
54 clearInterval(init);
55 resetTimer();
56 }
57}
58
59let init = setInterval(updateTimer, 1000);

Callers

nothing calls this directly

Calls 2

getTimeInFormatFunction · 0.85
resetTimerFunction · 0.85

Tested by

no test coverage detected