mirror of
https://github.com/pi-hole/web.git
synced 2026-08-23 06:39:09 +01:00
Coerce enableTimer text with Number() for consistency
The startup timer setup used `Math.trunc(enaT.text())` while `countDown()` uses `Math.trunc(Number(enaT.text()))`. Both work (the stored value is a clean millisecond timestamp), but wrap the value in `Number()` here too so the two call sites read the `#enableTimer` text identically. Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -615,7 +615,7 @@ $(() => {
|
||||
}
|
||||
|
||||
const enaT = $("#enableTimer");
|
||||
const target = new Date(Math.trunc(enaT.text()));
|
||||
const target = new Date(Math.trunc(Number(enaT.text())));
|
||||
const seconds = Math.round((target.getTime() - Date.now()) / 1000);
|
||||
if (seconds > 0) {
|
||||
setTimeout(countDown, 100);
|
||||
|
||||
Reference in New Issue
Block a user