From fefbe94a8c848481b62dd395839734b14bae9ae7 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Sat, 3 Aug 2024 12:02:46 +0200 Subject: [PATCH] Custom Matrix clock formats https://github.com/seerge/g-helper/issues/2903 --- app/AnimeMatrix/AnimeMatrixDevice.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/AnimeMatrix/AnimeMatrixDevice.cs b/app/AnimeMatrix/AnimeMatrixDevice.cs index 01c91d3a..a5c40111 100644 --- a/app/AnimeMatrix/AnimeMatrixDevice.cs +++ b/app/AnimeMatrix/AnimeMatrixDevice.cs @@ -404,12 +404,14 @@ namespace GHelper.AnimeMatrix public void PresentClock() { - string second = (DateTime.Now.Second % 2 == 0) ? ":" : " "; - string time = DateTime.Now.ToString("HH" + second + "mm"); + string timeFormat = AppConfig.GetString("matrix_time", "HH:mm"); + string dateFormat = AppConfig.GetString("matrix_date", "yy.MM.dd"); + + if (DateTime.Now.Second % 2 != 0) timeFormat = timeFormat.Replace(":", " "); Clear(); - Text(time, 15, 0, 25); - Text(DateTime.Now.ToString("yy'. 'MM'. 'dd"), 11.5F, 0, 14); + Text(DateTime.Now.ToString(timeFormat), 15, 0, 25); + Text(DateTime.Now.ToString(dateFormat), 11.5F, 0, 14); Present(); }