From dd487b8c0cc4a1541fb4c8ff57bc9c3a8c4ccc8d Mon Sep 17 00:00:00 2001 From: sagar2610 Date: Wed, 5 Feb 2014 12:39:48 +0530 Subject: [PATCH] Update bootstrap-datetimepicker.js I had a scenario where I could change the date even if I had made the text box readonly.When I have made the textbox readonly then I should not be able to set the value.So , I have applied a "if" condition which check whether the textbox is editable or not. --- src/js/bootstrap-datetimepicker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/bootstrap-datetimepicker.js b/src/js/bootstrap-datetimepicker.js index c566f890e..26fb448cd 100644 --- a/src/js/bootstrap-datetimepicker.js +++ b/src/js/bootstrap-datetimepicker.js @@ -166,6 +166,8 @@ set: function() { var formatted = ''; + if(!this.$element.find('input').attr('readonly')) + { if (!this._unset) formatted = this.formatDate(this._date); if (!this.isInput) { if (this.component){ @@ -178,6 +180,7 @@ this.$element.val(formatted); this._resetMaskPos(this.$element); } + } }, setValue: function(newDate) {