Here is my code:
$(function () {
$(\"#datepicker\").datepicker({ dateFormat: \'DD-MM-YY\' });
});
And the datetime picker is shown, but
C#:-
[Column(TypeName = "date")]
[Display(Name = "Date of Birth")]
[Required]
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
public DateTime? DOB { get; set; }
CSHTL:-
@Html.EditorFor(model => model.DOB, new { htmlAttributes = new { @class = "form-control" , @required = "required", @autocomplete="off"} })
$(document).ready(function () {
var validationerror = false;
$('input[type=date]').datepicker({
dateFormat: "yy-mm-dd",
changeMonth: true,
changeYear: true,
yearRange: "-60:+0"
});