Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #797 from DFE-Digital/feature/transfer-dates-and-h…
Browse files Browse the repository at this point in the history
…istory

Using dateshelper rather than ToFormattedDate
  • Loading branch information
dneed-nimble authored Jul 10, 2024
2 parents a03a36c + 678db93 commit eabce92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static string RemoveNonAlphanumericOrWhiteSpace(this string str)
}
public static string ToFormattedDate(this string dateStr)
{
if (DateTime.TryParse(dateStr, out DateTime date, ))
if (DateTime.TryParse(dateStr, out DateTime date))
{
return date.ToString("d MMMM yyyy");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "{urn}/transfer-dates/reason"
@using Dfe.PrepareTransfers.Helpers
@using Dfe.PrepareTransfers.Web.ExtensionMethods
@model Dfe.PrepareTransfers.Web.Pages.Projects.TransferDates.Reason
@{
Expand All @@ -23,7 +24,7 @@
Reasons for transfer date change
</h1>
</legend>
<p>The new proposed transfer date is <strong>@Model.TargetDate.ToFormattedDate()</strong>.</p>
<p>The new proposed transfer date is <strong>@DatesHelper.DateStringToGovUkDate(Model.TargetDate)</strong>.</p>
<form method="post" novalidate="">
<input type="hidden" asp-for="Urn" />
<input type="hidden" asp-for="TargetDate" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@using Dfe.PrepareTransfers.Data.Models
@using Dfe.PrepareTransfers.Data.Models.AdvisoryBoardDecision
@using Dfe.PrepareTransfers.Data.TRAMS
@using Dfe.PrepareTransfers.Helpers
@using Dfe.PrepareTransfers.Web.ExtensionMethods
@model Dfe.PrepareTransfers.Web.Pages.TaskList.DateHistory.DateHistory

Expand All @@ -24,7 +25,7 @@
@if ((Model.OpeningDateHistory == null || !Model.OpeningDateHistory.Any()) && Model.Project.Dates.Target is not null)
{
<h2 class="govuk-heading-l govuk-!-margin-bottom-12 govuk-!-font-size-36">Current proposed transfer date</h2>
<p class="govuk-body">The current proposed transfer date is <strong>@Model.Project.Dates.Target.ToFormattedDate()</strong>.</p>
<p class="govuk-body">The current proposed transfer date is <strong>@DatesHelper.DateStringToGovUkDate(Model.Project.Dates.Target)</strong>.</p>
}
else if ((Model.OpeningDateHistory == null || !Model.OpeningDateHistory.Any()) && Model.Project.Dates.Target is null)
{
Expand Down

0 comments on commit eabce92

Please sign in to comment.