From 54aec613ed25ec93f0bc4269c9d59a3c509216fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Sat, 21 Jan 2023 20:39:04 +0100 Subject: [PATCH] PowerControl: Show current time --- PowerControl/MenuStack.cs | 13 ++++++++++++- RELEASE.md | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PowerControl/MenuStack.cs b/PowerControl/MenuStack.cs index 09fb916..abf30bc 100644 --- a/PowerControl/MenuStack.cs +++ b/PowerControl/MenuStack.cs @@ -1,10 +1,16 @@ +using System.Globalization; + namespace PowerControl { internal class MenuStack { public static Menu.MenuRoot Root = new Menu.MenuRoot() { - Name = String.Format("\r\n\r\nPower Control v{0}\r\n", Application.ProductVersion.ToString()), + Name = String.Format( + "\r\n\r\nPower Control v{0} - \r\n", + Application.ProductVersion.ToString(), + Is24hClock ? "%H:%M:%S" : "%I:%M:%S %p" + ), Items = { Options.Profiles.Instance, @@ -33,5 +39,10 @@ namespace PowerControl Options.SteamController.Instance } }; + + private static bool Is24hClock + { + get => DateTimeFormatInfo.CurrentInfo.ShortTimePattern.Contains("HH"); + } } } diff --git a/RELEASE.md b/RELEASE.md index 0dc19e3..cf325ad 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,6 +9,7 @@ ## 0.6.x +- PowerControl: Show current time - PowerControl: Consider the foreground process to be holding profile configuration as long as it is running - SteamController: Require administrator privileges - PowerControl: Apply profile changes with a delay in bulk