Skip to content

Commit

Permalink
Fix risk due date humanizer calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
samgibsonmoj authored and carlsixsmith-moj committed Oct 24, 2024
1 parent 973a746 commit db53079
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 4 additions & 1 deletion src/Server.UI/Pages/Participants/Participant.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit db53079

Please sign in to comment.