-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added citation block * fix: fixed tests --------- Co-authored-by: Tom Whittington <[email protected]>
- Loading branch information
1 parent
4717926
commit 6c7ee39
Showing
18 changed files
with
251 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Dfe.ContentSupport.Web.Extensions; | ||
|
||
public static class DateTimeExtensions | ||
{ | ||
public static string ToLongString(this DateTime dateTime) | ||
{ | ||
return dateTime.ToString("dd MMMM yyyy"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<a class="govuk-link govuk-link--no-visited-state" href="#"> | ||
<div id="backtotop-button"> | ||
<a class="govuk-link govuk-link--no-visited-state" href="#"> | ||
<svg class="app-back-to-top__icon" xmlns="http://www.w3.org/2000/svg" width="13" height="17" viewBox="0 0 13 17"> | ||
<path fill="currentColor" d="M6.5 0L0 6.5 1.4 8l4-4v12.7h2V4l4.3 4L13 6.4z"></path> | ||
</svg> Back to top | ||
</a> | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@using Dfe.ContentSupport.Web.Extensions | ||
@model CsPage | ||
|
||
<div class="citation"> | ||
<div class="gem-c-metadata" data-gem-toggle-module-started="true" data-metadata-module-started="true" data-module="gem-toggle metadata"> | ||
<dl class="gem-c-metadata__list" data-gem-track-click-module-started="true" data-module="gem-track-click"> | ||
<dt class="gem-c-metadata__term">From:</dt> | ||
<dd class="gem-c-metadata__definition"> | ||
<a class="govuk-link" href="https://www.gov.uk/government/organisations/department-for-education">Department for Education</a> | ||
</dd> | ||
<dt class="gem-c-metadata__term">Published:</dt><dd class="gem-c-metadata__definition">@Model.CreatedAt!.Value.ToLongString()</dd> | ||
<dt class="gem-c-metadata__term">Updated:</dt><dd class="gem-c-metadata__definition">@Model.UpdatedAt!.Value.ToLongString()</dd> | ||
</dl> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/Dfe.ContentSupport.Web.Tests/Extensions/DateTimeExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Dfe.ContentSupport.Web.Extensions; | ||
|
||
namespace Dfe.ContentSupport.Web.Tests.Extensions; | ||
|
||
public class DateTimeExtensionsTests | ||
{ | ||
[Fact] | ||
public void ToLongString_Formats_Returns_Expected() | ||
{ | ||
var testValue = new DateTime(2024, 2, 1, 0, 0, 0, DateTimeKind.Local); | ||
const string expected = "01 February 2024"; | ||
|
||
var result = testValue.ToLongString(); | ||
|
||
result.Should().Be(expected); | ||
} | ||
} |
Oops, something went wrong.