1
0
Fork 0
mirror of synced 2024-07-10 16:55:46 +12:00

Fix duration as js

This commit is contained in:
Adria Navarro 2024-01-25 17:35:00 +01:00
parent 5a1d73ff2f
commit a14ff42b14
2 changed files with 2 additions and 1 deletions

View file

@ -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()

View file

@ -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 }