Hi,
I have one table with relevant fiedls
Id Name Date
Id-Primary key
Name-nvarchar
Date=datetime
i am going to do crud operation for that table
coming to my requirement
After clicking of edit button in grid view relevant date is not dipslaying properly
i need to display in date format here it was diplaying in string format
https://ibb.co/sRDJkWJ
https://ibb.co/dBQN0QG
Code for edit
............................
$scope.employee = emp.dat
$scope.Id = state.Id;
$scope.Name = state.Name;
$scope.ToDate = state.ToDate;
Could please any one help me
Note:i am using anjularjs and mvc

Faisal PathanRank #291 · 8.6K reputationPosted Feb 3, 2019, 9:48 PM EST
var shortDate = null;
if (jsonDate) {
var regex = /-?\d+/;
var matches = regex.exec(jsonDate);
var dt = new Date(parseInt(matches[0]));
var month = dt.getMonth() + 1;
var monthString = month > 9 ? month : '0' + month;
var day = dt.getDate();
var dayString = day > 9 ? day : '0' + day;
var year = dt.getFullYear();
shortDate = dayString + '/' + monthString + '/' + year;
}
return shortDate;
};
Faisal PathanRank #291 · 8.6K reputationPosted Jan 25, 2019, 6:02 PM EST
Faisal PathanRank #291 · 8.6K reputationPosted Jan 25, 2019, 6:05 PM EST
Mahesh ReddyRank #4,018 · 371 reputationPosted Jan 25, 2019, 10:56 PM EST