Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Feature: Provide option to also display dates & times in RFC3339 format [1449]

$
0
0
Suggestion for a small, focused feature: Current date & time display does not match editing formats when `@Html.Html5DateRenderingMode = Html5DateRenderingMode.Rfc3339` is in use. In particular we have RFC3339 overrides for editing `DataType.Date`, `DateTime`, `[DataType("datetime-local")]`, and `DataType.Time` values. However we have no similar display overrides.

The result is inconsistent, kind-of the inverse inconsistency to applying a `[DisplayFormat]` with `ApplyFormatInEditMode==false`. For example neither IE nor Chrome use a picker for `DateTime` values. (Yes Chrome uses a picker for `[DataType("datetime-local")]` values.) With my regional settings, the RFC3339 mode, and a `DateTime` value, display shows "11/23/2013 13:54:00" while editing shows "2013-11-23T13:54:00.000".

My specific suggestion to add another HTML helper property, perhaps `@Html.UseHtml5DateRenderingModeForDisplay` of type `bool`. Then add new methods to `DefaultDisplayTemplates` and use `TemplateHelpers._defaultDisplayActions` to associate these methods with "date", "datetime", "datetime-local", and "time" view names. These methods should use the same formats as the similar methods in `DefaultEditorTemplates` when `UseHtml5DateRenderingModeForDisplay == true` and `Html5DateRenderingMode == Html5DateRenderingMode.Rfc3339`.

Viewing all articles
Browse latest Browse all 7215

Trending Articles