Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Date(date).getFullYear();
});
nunjucks.env.addFilter('toDateWithoutTime', function(date) {
var fullDate = new Date(date);
return (fullDate.getUTCMonth() + 1) + '/' +
fullDate.getUTCDate() + '/' +
fullDate.getUTCFullYear();
});
nunjucks.env.addFilter('toTimeAgo', function(date) {
return moment(date).fromNow();
});
nunjucks.env.addFilter('split', function(str, splitChar, indexToReturn) {
var items = str.split(splitChar);
return items[indexToReturn];
});
nunjucks.env.addFilter('toFriendlyBytes', function(bytes) {
var roundToOneDecimal = function(x) { return Math.round(x * 10) / 10; };
if (bytes < 1024) {
return bytes + ' Bytes';
}
bytes /= 1024;
if (bytes < 1024) {
return roundToOneDecimal(bytes) + ' KB';
"use strict";
var nunjucks = require('nunjucks'),
modUtils = require('./modificationConfigUtils');
nunjucks.env.addFilter('modName', function(val) {
return modUtils.getHumanReadableName(val);
});
nunjucks.env.addFilter('modShortName', function(val) {
return modUtils.getHumanReadableShortName(val);
});
nunjucks.env.addFilter('modSummary', function(val) {
return modUtils.getHumanReadableSummary(val);
});
nunjucks.env.addFilter('modFill', function(val) {
return modUtils.getDrawOpts(val).fillColor;
});
"use strict";
var nunjucks = require('nunjucks');
nunjucks.env.addFilter('toFixed', function(val, digits) {
return val.toFixed(digits);
});
"use strict";
var nunjucks = require('nunjucks'),
modUtils = require('./modificationConfigUtils');
nunjucks.env.addFilter('modName', function(val) {
return modUtils.getHumanReadableName(val);
});
nunjucks.env.addFilter('modShortName', function(val) {
return modUtils.getHumanReadableShortName(val);
});
nunjucks.env.addFilter('modSummary', function(val) {
return modUtils.getHumanReadableSummary(val);
});
nunjucks.env.addFilter('modFill', function(val) {
return modUtils.getDrawOpts(val).fillColor;
});