I am currently facing an issue with a property in my Model
[Display(Name = "День рождения")]
[DataType(DataType.Date)]
public System.DateTime Birthday { get; set; }
When trying to save the value to the database using AJAX, it is also writing the Time along with Date.
<script>
$(document).ready(function () {
$('#save').click(function () {
save();
});
});
function save() {
$.ajax({
type: 'Post',
dataType: 'Json',
data: {
FIO: $('#FIO').val(),
Email: $('#Email').val(),
Salary: $('#Salary').val(),
Telephone: $('#Telephone').val(),
English: $('#english').val(),
City: $('#City').val(),
Birthday: $('#Birthday').val(),
id: $('#Interview_Id').val(),
},
url: '@Url.Action("WelcomeWriter", "Interwier")',
success: function (da) {
if (da.Result === "Success") {
window.location.href = da.RedirectUrl;
} else {
alert('Error' + da.Message);
}
},
error: function (da) {
alert('Error');
}
});
}
My goal is to only write the Date without the Time. How can I achieve this?