Understanding Skyview (or js or the browser logic ?)

me too, specially time in aviation ALWAYS is 24 hr clock format.

having said that, I found a remedy. easy.

by editing sudo nano usr/share/dump1090-fa/html/script.js
then CTRL + _ (underscore), in the nano (line,column prompt, put 1028 and ENTER)

just after that line, alter the code as follows

// NEED 24hr CLOCK and dd-mm-yyyy !

function refreshClock() {

// ORIG ==>     $('#clock_div').text(new Date().toLocaleString());

//-------------------------------//

        var dateNbr = new Date();
        var sDate = dateNbr.getDate();
        var sMonth = dateNbr.getMonth() + 1 ;
        var sYear = dateNbr.getFullYear();

        var sHours = dateNbr.getHours();
        var sMins = dateNbr.getMinutes();
        var sSecs = dateNbr.getSeconds();

        var TimeZoneID = "EEST";   // Eastern European Standard Time

        if (sDate < 10 )
           sDate = ("0" + sDate);

        if (sMonth < 10 )
           sMonth = ("0" + sMonth);

        if (sHours < 10 )
           sHours = ("0" + sHours);
        if (sMins < 10 )
           sMins = ("0" + sMins);
        if (sSecs < 10 )
           sSecs = ("0" + sSecs);

        var DateTimeStr = (sDate + "-"+ sMonth + "-" + sYear + " __   " + sHours + ":" + sMins + ":" + sSecs + " __  " + TimeZoneID);

        $('#clock_div').text(DateTimeStr);

//-----------------------------------//

and that’s all. what you get is this

now you would probably need to change ‘EEST’ to “CEST” to reflect your Belgian time zone.

HTH
evangel

ED1 : more meaningful variable names.
ED2: corrected the month calc.

1 Like