EasyUI Forum
May 02, 2024, 07:56:00 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Calendar setting problem in datebox and datetimebox  (Read 5029 times)
officecode
Jr. Member
**
Posts: 69


View Profile Email
« 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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')
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!