summaryrefslogtreecommitdiff
path: root/assets/js/core/utils.js
blob: 7d631526f79b31c1272e4d92b9bbc0789f026994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
KB.utils.formatDuration = function (d) {
    if (d >= 86400) {
        return Math.round(d/86400) + "d";
    }
    else if (d >= 3600) {
        return Math.round(d/3600) + "h";
    }
    else if (d >= 60) {
        return Math.round(d/60) + "m";
    }

    return d + "s";
};