-
Bug
-
Resolution: Fixed
-
Normal
-
6.5.8.1, 9.5.0, 9.1.0
-
Security Level: Jimmy
-
ZK 9.5.1 S1
-
None
Steps to Reproduce
https://zkfiddle.org/sample/5kjfs5/1-Datebox-Constraint-not-cleaning-beginning-and-end
run fiddle
Set a constraint using the 2nd button (constraint with between, begining or after)
remove the constraint with button 3 or 4
Current Result
The calendar popup still show disabled dates matching the first constrain, even though the constrain was removed
Expected Result
removing the constraint should remove the constraint
Debug Information
https://github.com/zkoss/zk/blob/master/zul/src/archive/web/js/zul/db/Calendar.js#L102-L105
disabled cell checks for calendar beginning and end
These are not cleaned by _fixConstraint if the constraint is removed
ex: set here:
https://github.com/zkoss/zk/blob/master/zul/src/archive/web/js/zul/db/Calendar.js#L571
not removed after
Workaround
<script><![CDATA[ zk.afterLoad("zul.db", function () { var _xCalendar = {}; zk.override(zul.db.Calendar.prototype, _xCalendar, { _fixConstraint: function() { var result = _xCalendar._fixConstraint.apply(this, arguments); var constraint = this._constraint || ''; if (typeof this._constraint != 'string') return; if( constraint == ''){ this._beg = null; this._end = null; } return result; } }); }); ]]></script>