xna-cncnet-client icon indicating copy to clipboard operation
xna-cncnet-client copied to clipboard

Use 24-hour time format in TopBar to prevent the string from going beyond the border

Open pzhlkj6612 opened this issue 1 year ago • 1 comments

Summary

If the time format settings of the OS contains an AM/PM designator, it will go beyond the right border of the window.

Why

The placeholder of lblTime is "99:99:99":

https://github.com/CnCNet/xna-cncnet-client/blob/624dfccd23011970ed2ce668888fd71132b0a560/DXMainClient/DXGUI/Generic/TopBar.cs#L161-L167

So I think using 24-hour format (HH:mm:ss) is OK.

Comparison

20220911-CnCNet-DXClient-TopBar-time-format

And...

There is a wrong time format string:

https://github.com/CnCNet/xna-cncnet-client/blob/624dfccd23011970ed2ce668888fd71132b0a560/DXMainClient/Domain/Multiplayer/CnCNet/MapSharer.cs#L418-L422

We should use "HH:mm:ss" instead of "hh:mm:ss" because "hh" is a number from 01 to 12. Since the code is commented out and not relevant to this PR, I didn't modify it.

See also: The "hh" custom format specifier § Custom date and time format strings | Microsoft Docs

pzhlkj6612 avatar Sep 11 '22 02:09 pzhlkj6612

Nightly build for this pull request:

  • artifacts.zip This comment is automatic and is meant to allow guests to get latest automatic builds without registering. It is updated on every successful build.

github-actions[bot] avatar Sep 11 '22 02:09 github-actions[bot]