11.0: DateFormat
Change the Format of DateTimeOffset
In this section, we change the format of DateTimeOffset
to trim off some of the fat and make it easier to read.
Go to ElevenNote.Web -> Views -> Shared
Create a new folder called DisplayTemplates
MVC will look for this folder to override the default format
Right click on the DisplayTemplates folder and click Add -> View
Fill it out like this, the View name should match the Data Type that we are using:
Delete everything in the file and replace with this:
@model System.DateTimeOffset? <span> @(Model.HasValue ? Model.Value.LocalDateTime.ToString("G") : "-") </span>
G
is the specific format we have chosen, here is a list of other options.Your view should look like this:
G
is for General date/time pattern (long time)
Next, we'll add the option to star a note.
Last updated