Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/datetime.js
- This file was added.
function timeOfDayToString(time, showSeconds = false) | |||||
{ | |||||
return showSeconds ? | |||||
// Translation: Format of the local time as shown for example in the realtime overlay, | |||||
// chat in the lobby, game setup, and session, and the lobby game start time. | |||||
// For a list of symbols that you can use, see: | |||||
// http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Field-Symbol-Table | |||||
Engine.FormatMillisecondsIntoDateStringLocal(time, translateWithContext("time of day, with seconds", "HH:mm:ss")) : | |||||
// Translation: Format of the local time as shown for example in the realtime overlay, | |||||
// chat in the lobby, game setup, and session, and the lobby game start time. | |||||
// For a list of symbols that you can use, see: | |||||
// http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Field-Symbol-Table | |||||
Engine.FormatMillisecondsIntoDateStringLocal(time, translateWithContext("time of day, without seconds", "HH:mm")); | |||||
} | |||||
function chatTimestampToString(time) | |||||
{ | |||||
// Translation: Time prefix as shown for example in the chat in the lobby, game setup, and session. | |||||
return sprintf(escapeText(translate("[%(time)s]")), { "time": timeOfDayToString(time) }); | |||||
} |
Wildfire Games · Phabricator