V
V
Vitaly Kudla2016-03-28 13:01:20
Angular
Vitaly Kudla, 2016-03-28 13:01:20

How to make a filter for time?

I have a string '120' , the output is '2 hours 00 min',
an example for the string '59' , the output is '59 min',
an example for the string '70' , the output is '1 hour 10 min'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rakro, 2016-03-28
@rakro

angular.module('app')
.filter('testFilter',function(){
return function(str){
var output = /алгоритм который превращает 120 в 2 часа 00 мин/
return output;
}
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question