From 76fc12e3a72fab607ee1a6daa309772874410d43 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Wed, 3 Mar 2021 15:23:42 +0900 Subject: [PATCH 1/3] age tweaks --- Core/Helper/SystemHelper.cs | 8 ++++---- Monitor/Pages/_get/DashboardTop.cshtml | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Core/Helper/SystemHelper.cs b/Core/Helper/SystemHelper.cs index 80d9b83..60845b1 100644 --- a/Core/Helper/SystemHelper.cs +++ b/Core/Helper/SystemHelper.cs @@ -470,15 +470,15 @@ namespace Core.Helper result += hours.ToString() + "h"; } - if (minutes > 0) + if ((days == 0) && (minutes > 0)) { - if (hours > 0 || days > 0) result += " "; + if (hours > 0) result += " "; result += minutes.ToString() + "m"; } - if ((!shortOutput && seconds > 0) || (shortOutput && days == 0)) + if ((hours == 0) && (seconds > 0)) { - if (minutes > 0 || hours > 0 || days > 0) result += " "; + if (minutes > 0) result += " "; result += seconds.ToString() + "s"; } diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index cd50fc4..80d5569 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -57,7 +57,7 @@ @if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0) { @buyLogEntry.Market } else { - @buyLogEntry.Market + @buyLogEntry.Market   } @string.Format("{0}%", (buyLogEntry.PercChange * 100).ToString("#,#0.00")) @string.Format("{0}", (buyLogEntry.Volume24h).ToString()) @@ -166,14 +166,15 @@ - + @if (mps == null || mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0) { @dcaLogEntry.Market } else { - @dcaLogEntry.Market + @dcaLogEntry.Market   + }
From f273d717083954a0c8bce081adabfeb6591ecbf0 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Wed, 3 Mar 2021 22:33:51 +0900 Subject: [PATCH 2/3] age logic error --- Core/Helper/SystemHelper.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Core/Helper/SystemHelper.cs b/Core/Helper/SystemHelper.cs index 60845b1..4b71bef 100644 --- a/Core/Helper/SystemHelper.cs +++ b/Core/Helper/SystemHelper.cs @@ -470,17 +470,28 @@ namespace Core.Helper result += hours.ToString() + "h"; } - if ((days == 0) && (minutes > 0)) + if (minutes > 0) { - if (hours > 0) result += " "; - result += minutes.ToString() + "m"; + if ( + (days == 0) || + (days > 0 && hours == 0) + ) + { + result += " "; + result += minutes.ToString() + "m"; + } } - if ((hours == 0) && (seconds > 0)) + if ( + (days == 0 && hours == 0) || + (days > 0 && hours == 0 && minutes == 0) || + (days == 0 && hours > 0 && minutes == 0) + ) { - if (minutes > 0) result += " "; + result += " "; result += seconds.ToString() + "s"; } + return result; } From b08d4dac0cf1329c4bad1ca7dd92cee8f1ba358f Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Thu, 4 Mar 2021 01:35:11 +0900 Subject: [PATCH 3/3] code formatting --- Core/Helper/SystemHelper.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Core/Helper/SystemHelper.cs b/Core/Helper/SystemHelper.cs index 4b71bef..9687e39 100644 --- a/Core/Helper/SystemHelper.cs +++ b/Core/Helper/SystemHelper.cs @@ -472,21 +472,14 @@ namespace Core.Helper if (minutes > 0) { - if ( - (days == 0) || - (days > 0 && hours == 0) - ) + if (days == 0 || (days > 0 && hours == 0)) { result += " "; result += minutes.ToString() + "m"; } } - if ( - (days == 0 && hours == 0) || - (days > 0 && hours == 0 && minutes == 0) || - (days == 0 && hours > 0 && minutes == 0) - ) + if ((days == 0 && hours == 0) || (days > 0 && hours == 0 && minutes == 0) || (days == 0 && hours > 0 && minutes == 0)) { result += " "; result += seconds.ToString() + "s";