Angular.js: Seconds to HH:mm:ss filter

后端 未结 6 2022
粉色の甜心
粉色の甜心 2020-12-15 17:34

I have a number of seconds count, for example, 713 seconds. How can I implement an Angular.js filter that converts this 713 seconds to HH:mm:ss format? In this case, it shou

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 18:22

    I think it is not necessary the custom filter

    {{hours}}{{seconds | date:':mm:ss'}}
    
    function Scoper($scope) {
        $scope.seconds = '79000';
        $scope.hours = parseInt($scope.seconds / 3600);
    }
    

提交回复
热议问题