summaryrefslogtreecommitdiffstats
path: root/lib/template/filters.js
blob: ac68b82ac75bdf0f11ac5040ac157cd488ac577d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var moment = require('moment');


module.exports = {
    // Format a date
    // ex: 'MMMM Do YYYY, h:mm:ss a
    date: function(time, format) {
        return moment(time).format(format);
    },

    // Relative Time
    dateFromNow: function(time) {
        return moment(time).fromNow();
    }
};