From 69082160fe2d045250d9971f6ee1bab997d02e0e Mon Sep 17 00:00:00 2001 From: Alessandro Biavati Date: Mon, 8 Apr 2024 11:24:32 +1000 Subject: [PATCH] fix(jquery-datepicker): clear value when datepicker is cleared --- src/jquery-ui-datepicker.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jquery-ui-datepicker.js b/src/jquery-ui-datepicker.js index 711a6b5d..4f6129cd 100644 --- a/src/jquery-ui-datepicker.js +++ b/src/jquery-ui-datepicker.js @@ -116,6 +116,10 @@ function init(Survey, $) { }; function setDateIntoQuestion() { var val = $el.datepicker('getDate'); + if (!val || typeof val.setHours !== 'function') { + question.value = ''; + return; + } var d = new Date(); val.setHours(d.getHours()); val.setMinutes(d.getMinutes());