I have an input in an asp.net mvc project, and the page receives values through a model, however the value is not showing on the page.
When I click F12 and inspect the datetime-local element, the value is there, but not shown.
The configure parameters datetime.
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd'T'HH:mm:ss}")] public DateTime DataPublicacao { get; set; } [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd'T'HH:mm:ss}")] public DateTime DataUltimaAlteracao { get; set; }
Div Dates
<div class="grid-duas-colunas">
<div class="form-group div-autor-1 col-4">
<label asp-for="DataPublicacao" class="control-label"></label>
<input asp-for="DataPublicacao" class="form-control" value="@Model.DataPublicacao"/>
<span asp-validation-for="DataPublicacao" class="text-danger"></span>
</div>
<div class="form-group div-autor-2 col-4">
<label asp-for="DataUltimaAlteracao" class="control-label"></label>
<input asp-for="DataUltimaAlteracao" class="form-control" value="@Model.DataUltimaAlteracao"/>
<span asp-validation-for="DataUltimaAlteracao" class="text-danger"></span>
</div>
</div>
Apparently, this formatting is not working correctly. What am I doing wrong?