Skip to content

Commit

Permalink
Opravení bugu
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamBenes3 committed Dec 1, 2023
1 parent 835bd3c commit 4f140c6
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -722,23 +722,20 @@
lastReloadTimeElement.style.backgroundColor = timestampBackgroundColor;
});
}
else {
now.setHours(timestamp.getHours() + 1);
var currentTimestamp = new Date();
var timeDifferenceInSeconds = (currentTimestamp - now) / 1000;
if (timeDifferenceInSeconds < 10) {
timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)';
} else if (timeDifferenceInSeconds >= 60 && timeDifferenceInSeconds <= 100) {
timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)';
} else {
timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)';
}
var lastReloadTimeElement = document.getElementById('lastReloadTime');
lastReloadTimeElement.style.backgroundColor = timestampBackgroundColor;
}
})
.catch(error => {
console.log('Error loading data: ', error);
var currentTimestamp = new Date();
var timeDifferenceInSeconds = (currentTimestamp - now) / 1000;
if (timeDifferenceInSeconds < 10) {
timestampBackgroundColor = 'rgba(0, 128, 0, 0.7)';
} else if (timeDifferenceInSeconds >= 10 && timeDifferenceInSeconds <= 100) {
timestampBackgroundColor = 'rgba(255, 165, 0, 0.7)';
} else {
timestampBackgroundColor = 'rgba(255, 0, 0, 0.7)';
}
var lastReloadTimeElement = document.getElementById('lastReloadTime');
lastReloadTimeElement.style.backgroundColor = timestampBackgroundColor;
console.log('Error loading data');
});
}
Expand Down

0 comments on commit 4f140c6

Please sign in to comment.