From 8e5aa4b17704fb0ae37df423366a369f99f1db09 Mon Sep 17 00:00:00 2001 From: samgibsonmoj Date: Thu, 24 Oct 2024 13:46:57 +0100 Subject: [PATCH 1/2] Fix risk due date humanizer calculation --- .../Pages/Participants/Components/CaseSummary.razor.cs | 7 +++++-- src/Server.UI/Pages/Participants/Participant.razor | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Server.UI/Pages/Participants/Components/CaseSummary.razor.cs b/src/Server.UI/Pages/Participants/Components/CaseSummary.razor.cs index 551b4d38..8be6bdb9 100644 --- a/src/Server.UI/Pages/Participants/Components/CaseSummary.razor.cs +++ b/src/Server.UI/Pages/Participants/Components/CaseSummary.razor.cs @@ -40,8 +40,11 @@ void SetRiskDueWarning() { if (ParticipantSummaryDto.RiskDue.HasValue) { - _riskInfo = DateOnly.FromDateTime(ParticipantSummaryDto.RiskDue!.Value!).Humanize(); - _riskTooltipText = String.Format("Due {0}", DateOnly.FromDateTime(ParticipantSummaryDto.RiskDue!.Value!)); + var datePart = ParticipantSummaryDto.RiskDue.Value.Date; + + _riskInfo = datePart.Humanize(); + _riskTooltipText = String.Format("Due {0}", DateOnly.FromDateTime(datePart)); + int _dueInDays = ParticipantSummaryDto.RiskDueInDays!.Value!; switch (_dueInDays) { diff --git a/src/Server.UI/Pages/Participants/Participant.razor b/src/Server.UI/Pages/Participants/Participant.razor index a298f808..7033d2df 100644 --- a/src/Server.UI/Pages/Participants/Participant.razor +++ b/src/Server.UI/Pages/Participants/Participant.razor @@ -187,7 +187,10 @@ { if (_participant!.RiskDue.HasValue) { - _riskInfo = String.Format("Due {0}", DateOnly.FromDateTime(_participant!.RiskDue!.Value).Humanize()); + var datePart = _participant.RiskDue.Value.Date; + + _riskInfo = datePart.Humanize(); + int _dueInDays = _participant!.RiskDueInDays!.Value; switch (_dueInDays) { From 72503c89e6250f90066ff94c3ab64a5476339b95 Mon Sep 17 00:00:00 2001 From: samgibsonmoj Date: Thu, 24 Oct 2024 13:49:48 +0100 Subject: [PATCH 2/2] Adjust 'Due XXX' text for tab tooltip --- src/Server.UI/Pages/Participants/Participant.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Server.UI/Pages/Participants/Participant.razor b/src/Server.UI/Pages/Participants/Participant.razor index 7033d2df..5d6b2709 100644 --- a/src/Server.UI/Pages/Participants/Participant.razor +++ b/src/Server.UI/Pages/Participants/Participant.razor @@ -189,7 +189,7 @@ { var datePart = _participant.RiskDue.Value.Date; - _riskInfo = datePart.Humanize(); + _riskInfo = $"Due {datePart.Humanize()}"; int _dueInDays = _participant!.RiskDueInDays!.Value; switch (_dueInDays)