Hello
I have a problem with an MVC project. My View needs to return values in Date for some Text Boxes (from the selection of the record by a Data Table) so that the user can edit the record.
The problem is that the data is not being shown in the correct format. TextBoxes show Strange Strings like this in place:
/ Date (1515290400000) /
My JavaScript function looks like this:
function GetDepSecById(DepartmentSectionId) {
$.ajax({
url: urlGetDepSecById,
data: { DepartmentSectionId: DepartmentSectionId },
type: 'POST',
success: function (result) {
$('#DepartmentSectionId').val(result.DepartmentSectionId);
$('#ObsoleteDate').val(result.ObsoleteDate);
$('#StartPeriodDate').val(result.StartPeriodDate);
$('#EndPeriodDate').val(result.EndPeriodDate);
DatePickerPadrao($('#ObsoleteDate'));
DatePickerPadrao($('#StartPeriodDate'));
DatePickerPadrao($('#EndPeriodDate'));
}
});
}
The DataPickerPadrao method is what should be responsible for converting the Data. It is within another JS in the project:
function DatePickerPadrao(control) {
control.datetimepicker(
{
locale: 'en-US',
format: 'MM/DD/YYYY'
});
}