Adding UTC clock to the receiver panel bottom.

This commit is contained in:
Marat Fayzullin 2023-06-24 00:27:37 -04:00
parent 70318b6893
commit 6eb19e8c5b
3 changed files with 23 additions and 0 deletions

View File

@ -753,6 +753,16 @@ img.openwebrx-mirror-img
border-radius: 3px;
}
#openwebrx-clock-utc
{
color: #aaa;
display: inline-block;
font-size: 10pt;
float: left;
margin-left: 5px;
font-family: 'roboto-mono';
}
#openwebrx-smeter-db
{
color: #aaa;

View File

@ -268,6 +268,7 @@
<div id="openwebrx-smeter">
<div class="openwebrx-smeter-bar"></div>
</div>
<div id="openwebrx-clock-utc">00:00 UTC</div>
<div id="openwebrx-smeter-db">0 dB</div>
</div>
</div>

View File

@ -1596,6 +1596,10 @@ function openwebrx_init() {
bookmarks = new BookmarkBar();
scanner = new Scanner(bookmarks, 1000);
initSliders();
// Run clock
setInterval(clock_changed, 60000);
clock_changed();
}
function initSliders() {
@ -1995,3 +1999,11 @@ function nr_changed() {
}
}));
}
function clock_changed() {
// Display UTC clock
const now = new Date();
const hours = ("00" + now.getUTCHours()).slice(-2);
const minutes = ("00" + now.getUTCMinutes()).slice(-2);
$("#openwebrx-clock-utc").html(`${hours}:${minutes} UTC`);
}