diff --git a/packages/string-templates/src/helpers/date.js b/packages/string-templates/src/helpers/date.js index 27554d1d9e..6fe8b288d6 100644 --- a/packages/string-templates/src/helpers/date.js +++ b/packages/string-templates/src/helpers/date.js @@ -115,7 +115,7 @@ module.exports.duration = (str, pattern, format) => { setLocale(config.str, config.pattern) const duration = dayjs.duration(config.str, config.pattern) - if (!isOptions(format)) { + if (format && !isOptions(format)) { return duration.format(format) } else { return duration.humanize() diff --git a/packages/string-templates/src/helpers/list.js b/packages/string-templates/src/helpers/list.js index 6d5241cdd8..92f5ee03ce 100644 --- a/packages/string-templates/src/helpers/list.js +++ b/packages/string-templates/src/helpers/list.js @@ -27,6 +27,7 @@ module.exports.getHelperList = () => { return helpers } +// Some helpers depend on handlebars injecting some parameters. This function adjust the helpers when required function adjustJsHelpers(helpers) { const result = { ...helpers }