mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Use the ES6 linting rules from the website (#138)
This commit is contained in:
@@ -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());
|
||||
|
||||
}
|
||||
|
@@ -5,8 +5,6 @@ module.exports = helper;
|
||||
function helper(hbs) {
|
||||
|
||||
// Convert a string to lower-case
|
||||
hbs.registerHelper('lowercase', function(context) {
|
||||
return context.toLowerCase();
|
||||
});
|
||||
hbs.registerHelper('lowercase', context => context.toLowerCase());
|
||||
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ module.exports = helper;
|
||||
function helper(hbs) {
|
||||
|
||||
// Simplify url by removing (eg http://, https://, trailing slashes) from url
|
||||
hbs.registerHelper('simplify-url', function(context) {
|
||||
hbs.registerHelper('simplify-url', context => {
|
||||
return context.replace(/^https?:\/\//i, '').replace(/\/$/, '').toLowerCase();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user