Created a custom formatter like this
const { padNumber, parseDate, formatDate } = require('../core/util');
module.exports = {
dateconv: function dateOtherConverter(str) {
if (str == null) return str;
return parseDate(str, "Y-m-d");
},
};
I get the error:
{“status”:“500”,“message”:“Date.parseDate is not a function”,“stack”:“TypeError: Date.parseDate is not a function\n at dateOtherConverter (/home/brian/nodejsapp/lib/formatters/custom.js:7:21)\n at /home/brian/nodejsapp/lib/core/parser.js:662:26\n at parser (/home/brian/nodejsapp/lib/core/parser.js:351:19)\n at Object.parseValue (/home/brian/nodejsapp/lib/core/parser.js:716:24)\n at App.parse (/home/brian/nodejsapp/lib/core/app.js:240:23)\n at App.setvalue (/home/brian/nodejsapp/lib/modules/core.js:103:26)\n at App._exec (/home/brian/nodejsapp/lib/core/app.js:219:57)\n at App._exec (/home/brian/nodejsapp/lib/core/app.js:201:28)\n at process._tickCallback (internal/process/next_tick.js:68:7)”}
Anyone any ideas?
Edit:
calling it like this (“datestring” it the input variable)
{{datestring.dateconv()}}