试图在表格中显示时间,但它以这种格式显示时间
{"Hours":16,"Minutes":8,"Seconds":45,"Milliseconds":0,"Ticks":581250000000,"Days":0,"TotalDays":0.6727430555555556,"TotalHours":16.145833333333332,"TotalMilliseconds":58125000,"TotalMinutes":968.75,"TotalSeconds":58125}
虽然我希望它以这种格式显示
"12:13:20"
在 Html 文件中,我确实像这样列出
<table>
<thead>
<tr>
<th>Start Time</th>
<th>End Time</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in Festivals">
<td>{{item.StartTime}}</td>
<td>{{item.EndTime}}</td>
</tr>
</tbody>
</table>
我正在初始化数据的角度控制器代码
var app = angular.module('myApp');
app.controller('SeasonCtrl', [
'$scope', '$http', 'seasonService', function ($scope, $http, seasonService) {
$scope.Seasons = [];
seasonService.GetAllSeasons = function () {
seasonService.getSeasons().success(function (data) {
$scope.Seasons = data.data;
})
}
seasonService.GetAllSeasons();
}
]);
C# 代码我将数据发送到角度控制器
public JsonResult GetAllSeasons()
{
var data = _seasonManager.AllSeasons();
if (data != null)
{
var list = data.Select(r => new
{
r.StartTime,
r.EndTime
});
return Json(new { data = list }, JsonRequestBehavior.AllowGet);
}
return null;
}