Use the ES6 linting rules from the website (#138)

This commit is contained in:
Rowan Manning
2016-07-22 14:34:10 +01:00
committed by GitHub
parent df8f5a7d07
commit e431fefbd8
33 changed files with 246 additions and 237 deletions

View File

@@ -15,26 +15,21 @@
'use strict';
var moment = require('moment');
const moment = require('moment');
module.exports = helper;
function helper(hbs) {
// Format a date with Moment
hbs.registerHelper('date-format', function(context, block) {
var format = block.hash.format || 'YYYY-MM-DD HH:mm:ss';
hbs.registerHelper('date-format', (context, block) => {
const format = block.hash.format || 'YYYY-MM-DD HH:mm:ss';
return moment(context).format(format);
});
// Get a relative date
hbs.registerHelper('date-relative', function(context) {
return moment(context).fromNow();
});
hbs.registerHelper('date-timestamp', function(context) {
return moment(context).valueOf();
});
hbs.registerHelper('date-relative', context => moment(context).fromNow());
hbs.registerHelper('date-timestamp', context => moment(context).valueOf());
}