Improvements to spot timing display #3

This commit is contained in:
Ian Renton
2025-12-22 20:44:50 +00:00
parent 1f66da062b
commit fb935138a1
4 changed files with 16 additions and 5 deletions

View File

@@ -117,10 +117,9 @@ function toggleFilterButtons(filterQuery, state) {
function updateRefreshDisplay() {
if (lastUpdateTime != null) {
let secSinceUpdate = moment.duration(moment().diff(lastUpdateTime)).asSeconds();
let updatingString = " Connected to live spot server.";
if (typeof REFRESH_INTERVAL_SEC !== 'undefined' && REFRESH_INTERVAL_SEC != null) {
let count = REFRESH_INTERVAL_SEC;
updatingString = "Updating..."
let updatingString = "Updating..."
if (secSinceUpdate < REFRESH_INTERVAL_SEC) {
count = REFRESH_INTERVAL_SEC - secSinceUpdate;
if (count <= 60) {
@@ -131,8 +130,10 @@ function updateRefreshDisplay() {
updatingString = "<span class='nowrap'>Updating in " + number + " minute" + (number != "1" ? "s" : "") + ".</span>";
}
}
$("#timing-container").html("Last updated at " + lastUpdateTime.format('HH:mm') + " UTC. " + updatingString);
} else {
$("#timing-container").html("Connected to live spot server. Last spot at " + lastUpdateTime.format('HH:mm') + " UTC.");
}
$("#timing-container").html("Last updated at " + lastUpdateTime.format('HH:mm') + " UTC. " + updatingString);
}
}