Improved DateTimeField (bypass time zone conversion if date-only, store/retrieve only the relevant components from the repository, surface the display mode as a property on the field).

This commit is contained in:
Daniel Stolt
2014-08-03 00:20:48 +02:00
parent f019392a93
commit 2dbf6f9b2b
7 changed files with 122 additions and 21 deletions

View File

@@ -10,7 +10,7 @@
<section class="audittrail-event-metadata-section">
@T("Event:") <strong>@descriptor.Name</strong><br />
@T("Category:") <strong>@descriptor.CategoryDescriptor.Name</strong><br />
@T("Timestamp:") <strong>@Display.DateTime(DateTimeUtc: record.CreatedUtc, CustomFormat: T("g"))</strong><br />
@T("Timestamp:") <strong>@Display.DateTime(DateTimeUtc: record.CreatedUtc)</strong><br />
@T("Username:") <strong>@record.UserName</strong>
</section>
<section class="audittrail-event-details-section">

View File

@@ -49,7 +49,7 @@
<td class="category-column">@record.CategoryDescriptor.Name</td>
<td class="event-column">@record.EventDescriptor.Name</td>
<td class="user-column">@record.Record.UserName</td>
<td class="timestamp-column">@Display.DateTime(DateTimeUtc: record.Record.CreatedUtc, CustomFormat: T("g"))</td>
<td class="timestamp-column">@Display.DateTime(DateTimeUtc: record.Record.CreatedUtc)</td>
<td class="summary-column">@Display(record.SummaryShape)</td>
<td class="comment-column">@record.Record.Comment</td>
<td class="actions-column">@Html.ActionLink(T("Details").Text, "Detail", "Admin", new { id = record.Record.Id, area = "Orchard.AuditTrail" }, null)</td>