diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-24 19:12:03 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-24 19:12:03 +0200 |
commit | 93b257314aa9a6ba240ff7d9534ddb1a6ded6bc0 (patch) | |
tree | fdb9103fe3d32c34326b7a13746668e2056a40de /lib/constants/defaultFilters.js | |
parent | 19a1db8cb43431352d30dbc48aebb9cc8bf58eec (diff) | |
download | gitbook-93b257314aa9a6ba240ff7d9534ddb1a6ded6bc0.zip gitbook-93b257314aa9a6ba240ff7d9534ddb1a6ded6bc0.tar.gz gitbook-93b257314aa9a6ba240ff7d9534ddb1a6ded6bc0.tar.bz2 |
Add default filters and blocks
Diffstat (limited to 'lib/constants/defaultFilters.js')
-rw-r--r-- | lib/constants/defaultFilters.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/constants/defaultFilters.js b/lib/constants/defaultFilters.js new file mode 100644 index 0000000..35025cc --- /dev/null +++ b/lib/constants/defaultFilters.js @@ -0,0 +1,15 @@ +var Immutable = require('immutable'); +var moment = require('moment'); + +module.exports = Immutable.Map({ + // 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(); + } +}); |