CnCNet / xna-cncnet-client

XNA / MonoGame based client for playing classic Command & Conquer games both online and offline with a CnCNet game spawner.
Other
226 stars 87 forks source link

Make locale-aware time fully displayed in TopBar to prevent the string from going beyond the border #388

Closed pzhlkj6612 closed 1 year ago

pzhlkj6612 commented 1 year ago

Hello!

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

I tried to remove the AM/PM designator; @Rans4ckeR reviewed my code and said:

The application should use correct localization, so en-US systems should display AM/PM. A proper solution is to update the layout instead. For example by changing the placeholder like this:

lblTime.Text = new DateTime(1, 1, 1, 23, 59, 59).ToLongTimeString();

source: https://github.com/CnCNet/xna-cncnet-client/pull/366#pullrequestreview-1103272340

That's better, isn't it? So I make this PR.

Here is the screenshot:

20221110-CnCNet-DXClient-TopBar-time-format

This PR will close #366 if gets merged.

github-actions[bot] commented 1 year ago

Nightly build for this pull request: