Skip to content

Commit 795b10d

Browse files
fix for #493
1 parent 2c22d7d commit 795b10d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/js/bootstrap-datetimepicker.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ THE SOFTWARE.
181181
fillSeconds();
182182
update();
183183
showMode();
184-
attachDatePickerEvents();
184+
if (!getPickerInput().prop('disabled')) {
185+
attachDatePickerEvents();
186+
}
185187
if (picker.options.defaultDate !== '' && getPickerInput().val() === '') {
186188
picker.setValue(picker.options.defaultDate);
187189
}
@@ -1182,6 +1184,9 @@ THE SOFTWARE.
11821184
};
11831185

11841186
picker.show = function (e) {
1187+
if (getPickerInput().prop('disabled')) {
1188+
return;
1189+
}
11851190
if (picker.options.useCurrent) {
11861191
if (getPickerInput().val() === '') {
11871192
if (picker.options.minuteStepping !== 1) {
@@ -1220,7 +1225,7 @@ THE SOFTWARE.
12201225
};
12211226

12221227
picker.disable = function () {
1223-
var input = picker.element.find('input');
1228+
var input = getPickerInput();
12241229
if (input.prop('disabled')) {
12251230
return;
12261231
}
@@ -1229,7 +1234,7 @@ THE SOFTWARE.
12291234
};
12301235

12311236
picker.enable = function () {
1232-
var input = picker.element.find('input');
1237+
var input = getPickerInput();
12331238
if (!input.prop('disabled')) {
12341239
return;
12351240
}

0 commit comments

Comments
 (0)