hbs.registerHelper('getGestpayJS', () => { if (properties.testEnv) { return 'https://sandbox.gestpay.net/pagam/JavaScript/js_GestPay.js'; } return 'https://ecomm.sella.it/pagam/JavaScript/js_GestPay.js'; });
hbs.registerHelper('capitalizar', (texto) => { let palabras = texto.split(' '); palabras.forEach((palabra, idx) => { palabras[idx] = palabra.charAt(0).toUpperCase() + palabra.slice(1).toLowerCase(); }); return palabras.join(' '); });
hbs.registerHelper('section', function (name, options) { if (!this._sections) { this._sections = {}; } this._sections[name] = options.fn(this); return null; });
hbs.registerHelper('getCurrentYear', () => { return new Date().getFullYear().toString(); });
// Setting Handlebars helpers hbs.registerHelper('getCurrentYear', () => { return new Date().getFullYear(); });
hbs.registerHelper('extend', function(name, context) { var block = blocks[name]; if (!block) { block = blocks[name] = []; } block.push(context.fn(this)); // for older versions of handlebars, use block.push(context(this)); });
// Helper to format date/time sent by Graph hbs.registerHelper('eventDateTime', function(dateTime){ return moment(dateTime).format('M/D/YY h:mm A'); });
hbs.registerHelper('block', function (name) { var val = (blocks[name] || []).join('\n'); // clear the block blocks[name] = []; return val; });
hbs.registerHelper('toUpper', (text) => { return text.toUpperCase(); });
/* Block helpers, e.g. for {{#section 'head'}}. `options` hash contains a function * (options.fn) that behaves like a normal compiled Handlebars template. * Specifically, the function will take a context and return a String. */ handlebars.registerHelper("section", function (name, options) { if (!this._sections) { this._sections = {}; } this._sections[name] = options.fn(this); return null; });
hbs.registerHelper('extend', function (name, context) { var block = blocks[name]; if (!block) { block = blocks[name] = []; } block.push(context.fn(this)); // for older versions of handlebars, use block.push(context(this)); });
// remove the comments for maintainance //app.use((req, res, next) => { // res.render('maintainance.hbs'); //}); hbs.registerHelper('getCurrentYear', () => { return new Date().getFullYear(); });
hbs.registerHelper('block', function(name) { var val = (blocks[name] || []).join('\n'); // clear the block blocks[name] = []; return val; });
// Helpers hbs.registerHelper('getAnio', () => { return new Date().getFullYear(); });
hbs.registerHelper('getCurrentYear', () => { return new Date().getFullYear(); });