Ticket #3350: lobby_local_time.patch

File lobby_local_time.patch, 1.0 KB (added by Imarok, 8 years ago)

localize lobby chat timestamp (Based on r17929

  • binaries/data/mods/public/gui/lobby/lobby.js

     
    988988    else
    989989        time = new Date(Date.now());
    990990
     991    // Convert from UTC to localtime
     992    let timeLocal = time.getTime() - new Date().getTimezoneOffset() * 60 * 1000;
    991993    // Translation: Time as shown in the multiplayer lobby (when you enable it in the options page).
    992994    // For a list of symbols that you can use, see:
    993995    // https://sites.google.com/site/icuprojectuserguide/formatparse/datetime?pli=1#TOC-Date-Field-Symbol-Table
    994     let timeString = Engine.FormatMillisecondsIntoDateString(time.getTime(), translate("HH:mm"));
     996    let timeString = Engine.FormatMillisecondsIntoDateString(timeLocal, translate("HH:mm"));
    995997
    996998    // Translation: Time prefix as shown in the multiplayer lobby (when you enable it in the options page).
    997999    let timePrefixString = sprintf(translate("\\[%(time)s]"), {