To use MomentJS in views/custom.ejs, what is the correct way (if any)?
Server side
routes/index etc we can easily use require(\'moment\');
require(\'moment\');
var moment = require('moment'); app.locals.moment = require('moment');
Use in the view:
<%= moment(myDateValue).fromNow() %>
Now you can simply use moment in your EJS files.