`{{date}}` unexpected behaviour
nataliethistime opened this issue · 2 comments
nataliethistime commented
I just started using handlebars-helpers
in a project today and found that anywhere I had used date
as a variable in my templates was now returning the current date (instead of my expected values). This surprised me as it seemed from the documentation that date
was itself not a function... Is this intended behaviour?
I am happy to submit a patch for the docs if this is indeed expected behaviour. Feel free to close this if I'm on the wrong track though...
Thanks!
maintux commented
Same here! Any hint about this?
In my case I don't have problem locally but on preprod or prod the helper returns the current date
nataliethistime commented
I have this in my code (which just removes the date
helper)
const handlebarsHelpers = require('handlebars-helpers');
//
// Delete the `date` helper so that it doesn't get confused with template variables named `date`.
//
let helpers = handlebarsHelpers();
delete helpers.date;
app.engine('handlebars', handlebars({ helpers }));
app.set('view engine', 'handlebars');