diff --git a/frappe/public/js/frappe/form/controls/duration.js b/frappe/public/js/frappe/form/controls/duration.js index 2808200b69..4369f29343 100644 --- a/frappe/public/js/frappe/form/controls/duration.js +++ b/frappe/public/js/frappe/form/controls/duration.js @@ -20,19 +20,19 @@ frappe.ui.form.ControlDuration = class ControlDuration extends frappe.ui.form.Co ` ); this.$wrapper.append(this.$picker); - this.build_numeric_input("days", this.duration_options.hide_days); - this.build_numeric_input("hours", false); - this.build_numeric_input("minutes", false); - this.build_numeric_input("seconds", this.duration_options.hide_seconds); + this.build_numeric_input("days", this.duration_options.hide_days, 0, "Days"); + this.build_numeric_input("hours", false, 0, "Hours"); + this.build_numeric_input("minutes", false, 0, "Minutes"); + this.build_numeric_input("seconds", this.duration_options.hide_seconds, 0, "Seconds"); this.set_duration_picker_value(this.value); this.$picker.hide(); this.bind_events(); this.refresh(); } - build_numeric_input(label, hidden, max) { + build_numeric_input(name, hidden, max, label) { let $duration_input = $(` - + `); let $input = $(`
`).prepend($duration_input); @@ -41,7 +41,7 @@ frappe.ui.form.ControlDuration = class ControlDuration extends frappe.ui.form.Co $duration_input.attr("max", max); } - this.inputs[label] = $duration_input; + this.inputs[name] = $duration_input; let $control = $(`