cms/app-client/app/helpers/milli-to-minutes.js
author ymh <ymh.work@gmail.com>
Tue, 17 Jan 2017 18:57:25 +0100
changeset 488 0161e028afb7
parent 476 9cffc7f32f14
permissions -rw-r--r--
Correct bug on display of notices on permalinks. Correct bug #0025750
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
476
9cffc7f32f14 correct transcripts without topics
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import Ember from 'ember';
9cffc7f32f14 correct transcripts without topics
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
9cffc7f32f14 correct transcripts without topics
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
export function milliToMinutes(params/*, hash*/) {
9cffc7f32f14 correct transcripts without topics
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
    var seconds = ((params[0]/1000) % 60).toFixed(0);
9cffc7f32f14 correct transcripts without topics
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
    return Math.floor((params[0]/1000) / 60) + ":" + (seconds < 10 ? '0' : '') + seconds;
9cffc7f32f14 correct transcripts without topics
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
}
9cffc7f32f14 correct transcripts without topics
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
9cffc7f32f14 correct transcripts without topics
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
export default Ember.Helper.helper(milliToMinutes);