VirtualBox

Changeset 84885 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Jun 21, 2020 1:35:38 AM (4 years ago)
Author:
vboxsync
Message:

TestManager: Some date fixes in the VCS popups and xtracker hacks. bugref:9778

Location:
trunk/src/VBox/ValidationKit/testmanager/htdocs/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/htdocs/js/common.js

    r84621 r84885  
    234234            cMinTz = -cMinTz;
    235235
    236         return new Date(oDate.getTime() + cMinTz * 60000);
     236        return new Date(oDate.getTime() - cMinTz * 60000);
    237237    }
    238238    console.assert(false);
    239239    return oDate;
     240}
     241
     242/**
     243 * @param   oDate   Date object.
     244 */
     245function formatTimeHHMM(oDate, fNbsp)
     246{
     247    var sTime = oDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit'} );
     248    if (fNbsp === true)
     249        sTime = sTime.replace(' ', '\u00a0');
     250
     251    /* Workaround for single digit hours in firefox with en_US (minutes works fine): */
     252    var iHours = oDate.getHours();
     253    if ((iHours % 12) < 10)
     254    {
     255        var ch1 = sTime.substr(0, 1);
     256        var ch2 = sTime.substr(1, 1);
     257        if (  ch1 == (iHours % 12).toString()
     258            && !(ch2 >= '0' && ch2 <= '9'))
     259            sTime = '0' + sTime;
     260    }
     261    return sTime;
    240262}
    241263
     
    10271049function tooltipElementOnMouseEnter()
    10281050{
    1029     console.log('tooltipElementOnMouseEnter: arguments.length='+arguments.length+' [0]='+arguments[0]);
    1030     console.log('ENT: currentTarget='+arguments[0].currentTarget+' id='+arguments[0].currentTarget.id+' class='+arguments[0].currentTarget.className);
     1051    /*console.log('tooltipElementOnMouseEnter: arguments.length='+arguments.length+' [0]='+arguments[0]);
     1052    console.log('ENT: currentTarget='+arguments[0].currentTarget+' id='+arguments[0].currentTarget.id+' class='+arguments[0].currentTarget.className); */
    10311053    tooltipResetShowTimer();
    10321054    tooltipResetHideTimer();
     
    10451067{
    10461068    var oEvt = arguments[0];
    1047     console.log('tooltipElementOnMouseOut: arguments.length='+arguments.length+' [0]='+oEvt);
    1048     console.log('OUT: currentTarget='+oEvt.currentTarget+' id='+oEvt.currentTarget.id+' class='+oEvt.currentTarget.className);
     1069    /*console.log('tooltipElementOnMouseOut: arguments.length='+arguments.length+' [0]='+oEvt);
     1070    console.log('OUT: currentTarget='+oEvt.currentTarget+' id='+oEvt.currentTarget.id+' class='+oEvt.currentTarget.className);*/
    10491071
    10501072    /* Ignore the event if leaving to a child element. */
     
    12061228function svnHistoryTooltipNewOnReadState(oTooltip, oRestReq, oParent)
    12071229{
    1208     console.log('svnHistoryTooltipNewOnReadState');
     1230    /*console.log('svnHistoryTooltipNewOnReadState: status=' + oRestReq.status + ' readyState=' + oRestReq.readyState);*/
     1231    if (oRestReq.readyState != oRestReq.DONE)
     1232    {
     1233        oTooltip.oInnerElm.innerHTML = '<p>Loading ...(' + oRestReq.readyState + ')</p>';
     1234        return true;
     1235    }
    12091236
    12101237    /*
     
    12681295            sHtml += '<a href="' + oResp.sTracChangesetUrlFmt.replace('%(iRevision)s', oCommit.iRevision.toString());
    12691296            sHtml += '" target="_blank">';
    1270             sHtml += '<span class="tmvcstimeline-time">' + escapeElem(tsCreated.toLocaleTimeString()) + '</span>'
     1297            sHtml += '<span class="tmvcstimeline-time">' + escapeElem(formatTimeHHMM(tsCreated, true)) + '</span>'
    12711298            sHtml += ' Changeset <span class="tmvcstimeline-rev">[' + oCommit.iRevision + ']</span>';
    12721299            sHtml += ' by <span class="tmvcstimeline-author">' + escapeElem(oCommit.sAuthor) + '</span>';
     
    12801307    }
    12811308
    1282     console.log('svnHistoryTooltipNewOnReadState: sHtml=' + sHtml);
     1309    /*console.log('svnHistoryTooltipNewOnReadState: sHtml=' + sHtml);*/
    12831310    oTooltip.oInnerElm.innerHTML = sHtml;
    12841311
     
    14191446
    14201447        var oTooltip = g_dTooltips[sKey];
    1421         console.log('svnHistoryTooltipNewDelayedShow: ' + sRepository + ' ' + oTooltip);
     1448        /*console.log('svnHistoryTooltipNewDelayedShow: ' + sRepository + ' ' + oTooltip);*/
    14221449        if (!oTooltip)
    14231450        {
     
    14251452             * Create a new tooltip element.
    14261453             */
    1427             console.log('creating ' + sKey);
     1454            /*console.log('creating ' + sKey);*/
    14281455
    14291456            var oElm = document.createElement('div');
  • trunk/src/VBox/ValidationKit/testmanager/htdocs/js/vcsrevisions.js

    r84620 r84885  
    4040function vcsRevisionFormatTime(tsDate)
    4141{
    42     var sRet = tsDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit'} );
    43     return sRet.replace(' ', '\u00a0');
     42    return formatTimeHHMM(tsDate, true /*fNbsp*/);
    4443}
    4544
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette