From fce9220dcb9844ea85c41d61e4534076c96063e1 Mon Sep 17 00:00:00 2001
From: Leigh
Date: Tue, 2 Nov 2021 07:01:24 +0100
Subject: [PATCH] Update for #1753 Date format for the Audit
Added Parameter DateTimeFormat with default value of "MMM dd yyyy HH:mm:ss"
---
Oqtane.Client/Modules/Controls/AuditInfo.razor | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Oqtane.Client/Modules/Controls/AuditInfo.razor b/Oqtane.Client/Modules/Controls/AuditInfo.razor
index 1584fd6e..d36e7f9a 100644
--- a/Oqtane.Client/Modules/Controls/AuditInfo.razor
+++ b/Oqtane.Client/Modules/Controls/AuditInfo.razor
@@ -35,6 +35,9 @@
[Parameter]
public string Style { get; set; }
+ [Parameter]
+ public string DateTimeFormat { get; set; } = "MMM dd yyyy HH:mm:ss";
+
protected override void OnParametersSet()
{
_text = string.Empty;
@@ -49,7 +52,7 @@
if (CreatedOn != null)
{
- _text += $" {Localizer["On"]} {CreatedOn.Value.ToString("MMM dd yyyy HH:mm:ss")}";
+ _text += $" {Localizer["On"]} {CreatedOn.Value.ToString(DateTimeFormat)}";
}
_text += "
";
@@ -66,7 +69,7 @@
if (ModifiedOn != null)
{
- _text += $" {Localizer["on"]} {ModifiedOn.Value.ToString("MMM dd yyyy HH:mm:ss")}";
+ _text += $" {Localizer["on"]} {ModifiedOn.Value.ToString(DateTimeFormat)}";
}
_text += "";
@@ -83,7 +86,7 @@
if (DeletedOn != null)
{
- _text += $" {Localizer["On"]} {DeletedOn.Value.ToString("MMM dd yyyy HH:mm:ss")}";
+ _text += $" {Localizer["On"]} {DeletedOn.Value.ToString(DateTimeFormat)}";
}
_text += "";