Skip to content

Commit 9f42bf7

Browse files
author
Dmitry Kuzin (DevExpress)
committed
Fix #130
1 parent b3a1584 commit 9f42bf7

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/jquery-ui-datepicker.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,21 @@ function init(Survey, $) {
8383
question.readOnlyChangedCallback = function () {
8484
$el.datepicker("option", "disabled", question.isReadOnly);
8585
};
86-
question.readOnlyChangedCallback();
87-
86+
function updateDate() {
87+
if (question.value) {
88+
pickerWidget.datepicker("setDate", question.value);
89+
} else {
90+
pickerWidget.datepicker("setDate", null);
91+
}
92+
}
93+
question.registerFunctionOnPropertyValueChanged("dateFormat", function () {
94+
question.dateFormat && pickerWidget.datepicker("option", "dateFormat", question.dateFormat);
95+
updateDate();
96+
}
97+
);
8898
question.valueChangedCallback = function () {
8999
if (!isSelecting) {
90-
if (question.value) {
91-
pickerWidget.datepicker("setDate", question.value);
92-
} else {
93-
pickerWidget.datepicker("setDate", null);
94-
}
100+
updateDate();
95101
$el.blur();
96102
}
97103
};

0 commit comments

Comments
 (0)