0
私のSQL Serverでは、date
データ型を持つ列があり、ここにはサンプル2017-09-28
があります。 Sql Dateの日付の値は、anglejを使用してのみ値
[Display(Name = "Enroll Date")]
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
public DateTime CreationDate { get; set; }
と私の角度コントローラのコントローラ:私は、表示形式としてこれでモデルを作成し
<tr ng-repeat="record in records">
<td>{{record.Id}}</td>
<td>{{record.RfidNumber}}</td>
<td>{{record.RfidTag}}</td>
<td>{{record.AccountName}}</td>
<td>{{record.CreationDate | date:'dd/MM/yyyy'}}</td>
<td>{{record.EncodedBy}}</td>
</tr>
:
var app = angular.module("MyApp", []);
app.controller("PdfController", function($scope, $http) {
$scope.message = "";
$scope.records = null;
$http({
method: 'GET',
url: '/Pdf/GetData'
}).then(function(result) {
$scope.records = result.data;
},
function(error) {
$scope.message = "Error in retrieving data @error: " + error;
});
})
は、私の見解で、私はそうのようなNGリピートを使用しました
なぜ私のテーブルでこの値が/Date(1506528000000)/
になるのですか?それをdd/MM/yyyy
にフォーマットできないのはなぜですか?モデルをpublic string CreationDate { get; set; }
に設定しようとしました。それは私に日付を与えるが、と私は時間が必要ない。あなたは助けてもらえますか?ありがとうございました。
ありがとうHTMLにフィルタを追加します。これは魅力的に機能しました。今私はフィルタを使用する方法を知っている! – Ibanez1700