EasyUI Forum

General Category => Bug Report => Topic started by: officecode on November 13, 2018, 10:06:33 PM



Title: Calendar setting problem in datebox and datetimebox
Post by: officecode on November 13, 2018, 10:06:33 PM
For example the following code:
Code:
$('#test').datebox({
value:'2015-10-10'
}).datebox('calendar').calendar('options').validator = function(d){
return d.getDay() != 6 && d.getDay() != 0
}
The validator in the above code does not work.
If you change the value to any other non-Saturday or Sunday date, it will work fine.


Title: Re: Calendar setting problem in datebox and datetimebox
Post by: stworthy on November 14, 2018, 12:16:47 AM
You set the 'validator' after creating the component. So the datebox will remain its original value. Please call 'setValue' method after changing the 'validator' property.
Code:
$('#test').datebox({
//...
}).datebox('calendar').calendar('options').validator = function(d){
return d.getDay() != 6 && d.getDay() != 0
}
$('#test').datebox('setValue','2015-10-10')