var Handlebars = require('handlebars');
var moment = require('moment');

module.exports = {
  nl2br: function(value) {
    value = value || '';
    var html = (value).replace(/\n/g, '<br>');
    return new Handlebars.SafeString(html);
  },
  formatMMMMYYYY: function(value) {
    value = value || '';
    var html = moment(new Date((value))).format('MMMM YYYY');
    return new Handlebars.SafeString(html);
  },
  formatMMMDDYYYY: function(value) {
    value = value || '';
    var html = moment(new Date((value))).format('MMM DD, YYYY');
    return new Handlebars.SafeString(html);
  },
  sanitizePhone: function(value) {
    value = value || '';
    var html = (value).replace(/[-\s]/g, '');
    return new Handlebars.SafeString(html);
  },
  sanitizeURL: function(value) {
    value = value || '';
    var html = (value).replace(/http?s:\/\//g, '');
    return new Handlebars.SafeString(html);
  },
};

@@ -895,11 +895,260 @@
 );%0A  %7D,%0A
+  humaneDuration: function(start, end) %7B%0A    start = start %7C%7C '';%0A    var endTimestamp = end ? new Date(end).getTime() : Date.now();%0A    var duration = endTimestamp - (new Date(start).getTime());%0A    return moment.duration(duration).humanize();%0A  %7D%0A
 %7D;%0A

Add helper for durations