I have the following field in my model:
[Required]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public DateTime? DataCadastro { get; set; }
I use the DisplayFormat to format and display the date in Brazilian format later on a DataTable. But it is not being ordered properly. Do I need to put anything else in the dataTable?
$('#table-controle').html(data);
dataTable = $('#table-controle').dataTable({
"language": {
"url": "../../../Content/json/Portuguese-Brasil.json"
}
});