Fix duration as js
This commit is contained in:
parent
5a1d73ff2f
commit
a14ff42b14
|
@ -115,7 +115,7 @@ module.exports.duration = (str, pattern, format) => {
|
||||||
setLocale(config.str, config.pattern)
|
setLocale(config.str, config.pattern)
|
||||||
|
|
||||||
const duration = dayjs.duration(config.str, config.pattern)
|
const duration = dayjs.duration(config.str, config.pattern)
|
||||||
if (!isOptions(format)) {
|
if (format && !isOptions(format)) {
|
||||||
return duration.format(format)
|
return duration.format(format)
|
||||||
} else {
|
} else {
|
||||||
return duration.humanize()
|
return duration.humanize()
|
||||||
|
|
|
@ -27,6 +27,7 @@ module.exports.getHelperList = () => {
|
||||||
return helpers
|
return helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some helpers depend on handlebars injecting some parameters. This function adjust the helpers when required
|
||||||
function adjustJsHelpers(helpers) {
|
function adjustJsHelpers(helpers) {
|
||||||
const result = { ...helpers }
|
const result = { ...helpers }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue