From bbd449855fcd604f0cc603db25675c221e71830b Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 2 Sep 2021 11:04:18 +0200 Subject: [PATCH] Cancel adding a closing date --- www/form/inner.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/form/inner.js b/www/form/inner.js index 9dc726ee4..f96bb6d13 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -3399,14 +3399,21 @@ define([ }); var save = h('button.btn.btn-primary', Messages.settings_save); $(save).click(function () { + if (dataPicker.value === '') { + return void refreshEndDate(); + } var d = picker.parseDate(datePicker.value); content.answers.endDate = +d; framework.localChange(); refreshEndDate(); }); + var cancel = h('button.btn.btn-danger', h('i.fa.fa-times')); + $(cancel).click(function () { + refreshEndDate(); + }); var confirmContent = h('div', [ h('div', Messages.form_setEnd), - h('div.cp-form-input-block', [datePicker, save]), + h('div.cp-form-input-block', [datePicker, save, cancel]), ]); $button.after(confirmContent); $button.remove();