I use Jade templates both in express app and in the browser. I need to format data before placing it in inputs.
Should I extend locals with alike both in node.js and in browser?
{ formatDate: function(date) {}, ... }
Or are there any best practices to pass helper functions (e.g. to format money, dates etc.) to jade templates?
Ended up extending locals both server- and client-side.
For dates, check out: http://moment.js
eg. moment().format('MMMM Do YYYY, h:mm:ss a');
Available as both an NPM package + client side.