1
I need to show only the date format in a Datetime field, but only letters are appearing in the field (even if the value property contains a date).
VIEWMODEL:
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
[DataType(DataType.Date, ErrorMessage = "Data em formato inválido")]
[DisplayName("Data de Emissão")]
public DateTime DataEmissao { get; set; }
RAZOR:
<input type="date" asp-for="DataEmissao" id="financeiro-parcela-data-emissao" class="form-control" />
HTML:
<input type="date" id="financeiro-parcela-data-emissao" class="form-control" data-val="true" data-val-required="The Data de Emissão field is required." name="DataEmissao" value="03/11/2020 00:00:00">
Does anyone know how to solve?
Thank you :)
It’s from the browser itself
– novic
Interesting@novic is that if I change type="date" to type="datetime", in Razor, it works correctly, but displaying date + time... I just wanted it to be the date...
– Master JR
the
datetime
even it seems that it is depreciated kkk if I am not mistaken. nonsense this change– novic