Search Posts

How to show only time of date in AngularJS?

Hi All How to show only time value in angular js?

  • My Plunker

  • I have fetched time value using of ng-repeat, and I just want to show only time value in my portal.

  • I were tried to fetch time value like <p>3. TIME</p><span><h4>{{user.time | date:'medium'}}</h4></span>

  • For example:- Instead of Jan 1, 1970 10:00:00 PM i want to show only the time 10:00:00 PM

  • How to do this please help us thanks.

My 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>

My Data:-

$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
    }
]

Source: AngularJS

Leave a Reply

Your email address will not be published. Required fields are marked *