MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / updateCountdown

Function updateCountdown

assets/js/CustomCount.js:59–77  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

57}
58
59function updateCountdown(e) {
60 e.preventDefault();
61 // Set title and date, save to localStorage
62 countdownTitle = e.srcElement[0].value;
63 countdownDate = e.srcElement[1].value;
64 savedCountdown = {
65 title: countdownTitle,
66 date: countdownDate,
67 };
68 localStorage.setItem('countdown', JSON.stringify(savedCountdown));
69 // Check if no date entered
70 if (countdownDate === '') {
71 alert('Please select a date for the countdown.');
72 } else {
73 // Get number version of current Date, updateDOM
74 countdownValue = new Date(countdownDate).getTime();
75 updateDOM();
76 }
77}
78
79function reset() {
80 // Hide countdowns, show input form

Callers

nothing calls this directly

Calls 2

stringifyMethod · 0.80
updateDOMFunction · 0.70

Tested by

no test coverage detected