Page MenuHomeWildfire Games

Add timeOfDayToString and chatTimestampToString functions
Needs ReviewPublic

Authored by temple on Dec 6 2017, 4:37 AM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Add timeOfDayToString and chatTimestampToString functions.

Test Plan

Agree they're nice.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 3972
Build 6959: Vulcan BuildJenkins
Build 6958: arc lint + arc unit

Event Timeline

temple created this revision.Dec 6 2017, 4:37 AM
Owners added a subscriber: Restricted Owners Package.Dec 6 2017, 4:37 AM
Vulcan added a subscriber: Vulcan.Dec 6 2017, 4:39 AM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
elexis added a subscriber: elexis.Dec 7 2017, 3:21 PM
elexis added inline comments.
binaries/data/mods/public/gui/common/l10n.js
6

Where does that :ss come from again? Doesn't hurt adding them?

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

I never noticed the duplication (triplication technically)!

temple added inline comments.Dec 7 2017, 3:47 PM
binaries/data/mods/public/gui/common/l10n.js
6

I should've made a note here, it's the seconds. The realtime overlay currently shows them and all the other places don't show them. So either we could have two functions, one showing seconds and one not showing them, or we could decide on one format. I'd actually prefer to not show the seconds because I think it's unnecessary, and actually in the US-english version I don't include them (I use "H:mm a" which gives times like "8:44 AM"). So let me remove the :ss.

temple added inline comments.Dec 7 2017, 3:57 PM
binaries/data/mods/public/gui/common/l10n.js
6

"h:mm a" actually.

elexis added a comment.Dec 7 2017, 6:45 PM

Hm. The seconds in the overlay enabled one to count how many real seconds passed in one game second. In the chat they wouldn't hurt too much though certainly not necessary.
Perhaps we want two formats and pass it as a boolean if we want to show the seconds?

binaries/data/mods/public/gui/common/l10n.js
1

timeToString?

temple added a comment.Dec 8 2017, 4:31 AM
In D1117#44882, @elexis wrote:

Hm. The seconds in the overlay enabled one to count how many real seconds passed in one game second. In the chat they wouldn't hurt too much though certainly not necessary.

For measuring lag? Because we show (2x) when at different speeds. The US will have AM/PM there too, will be crowded.

Perhaps we want two formats and pass it as a boolean if we want to show the seconds?

Doesn't hurt. So I'll add it to the realtime overlay for now.

binaries/data/mods/public/gui/common/l10n.js
1

We don't want people using this function when they should use durationToString, so I think it's better to emphasize that it's a time of day.

temple updated this revision to Diff 4642.Dec 8 2017, 4:32 AM
temple updated this revision to Diff 4644.Dec 8 2017, 4:45 AM
Vulcan added a comment.Dec 8 2017, 5:11 AM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Vulcan added a comment.Dec 8 2017, 5:15 AM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
temple added a reviewer: Restricted Owners Package.Jan 17 2018, 1:21 AM