如何在 AngularJS 中仅显示日期时间?

How to show only time of date in AngularJS?

大家好 如何在angular js中只显示时间值?

我的Html:-

<div ng-repeat="user in users">
  <p>1. Name</p><span><h4>{{user.title}}</h4></span>
  <p>2. Day</p><span><h4>{{user.day}}</h4></span>
  <p>3. TIME</p><span><h4>{{user.time | date:'medium'}}</h4></span>
</div>

我的数据:-

$scope.users = [
    {
        "_id": "5a33880dd725a05813014c22",
        "user": {
            "_id": "59df6a76b6748bc809050697",
            "displayName": "Maniselvam selvam",
            "dob": "1991-05-10T07:00:00.000Z",
            "profileImageURL": "./modules/users/client/img/ownprofile/uploads/a7d398db972da9dcb1c90480353d00c0"
        },
        "__v": 2,
        "openeyers": [],
        "time": "1970-01-01T16:30:00.000Z",
        "day": "Wednesday",
        "registration_number": "Test3",
        "title": "Mercy",
        "created": "2017-12-15T08:30:05.357Z",
        "isCurrentUserOwner": true
    }
]

而不是

{{user.time | date:'medium'}}

使用

{{user.time | date:'mediumTime'}}

in the docs

'mediumTime': equivalent to 'h:mm:ss a' for en_US locale (e.g. 12:05:08 PM)