refresh /orgy at 20:00 too

master
Aevann 2023-09-20 20:56:24 +03:00
parent c9e2179b05
commit b632ff5e4a
1 changed files with 13 additions and 5 deletions

View File

@ -42,9 +42,17 @@ orgy_file.addEventListener("timeupdate", function(){
const now = new Date();
const now_utc = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
let millis = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), 0, 0, 10) - now;
if (millis < 0)
millis += 86400000;
let millis_00 = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), 0, 0, 10) - now;
if (millis_00 < 0)
millis_00 += 86400000;
console.log(millis/1000/60)
setTimeout(() => location.reload(), millis);
console.log(millis_00/1000/60)
setTimeout(() => location.reload(), millis_00);
let millis_20 = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), 20, 0, 10) - now;
if (millis_20 < 0)
millis_20 += 86400000;
console.log(millis_20/1000/60)
setTimeout(() => location.reload(), millis_20);