Using multiple disabledDatesRule in YUI3 calender

自作多情 提交于 2019-12-11 18:17:53

问题


I am loading up a calendar that blocks out dates dynamically, extracting them from a datasource. The problem is, I cannot set multiple disabledDatesRules. It is either one or the other. Which seems kind of silly and not helpful, at all, especially with the way rules are set up. I can't imagine that is the case, so I was wondering if anyone knew how to use multiple disabledDatesRule. For example,

 var settings = {
       contentBox: "#calendar",
       width:'340px', 
       selectionMode: 'multiple',
       date: new Date()
     };
    var dtdate = Y.DataType.Date;
    var rules = {};
    rules[dYear] = {}
    rules[dYear][dMonth] = {}
    rules[dYear][dMonth][dWeek] = {}
    rules[dYear][dMonth][dWeek][friday] = 'weekdays'
    rules[dYear][dMonth][Weeks] = 'Weeks'
    settings.disabledDatesRule = 'Weeks','weekdays';
    var calendar = new Y.Calendar(settings).render(); 

I have not seen any help with this anywhere. I have seen how to make certain dates prettier, but that doesn't help me in the slightest.

Thanks.


回答1:


I am the creator of the YUI 3 calendar, and just confirming that your solution is correct -- you can have multiple different rules with the same name, and they will all match.

There's going to be more flexible ways to define rules coming up in the next couple releases, too.



来源:https://stackoverflow.com/questions/12497284/using-multiple-disableddatesrule-in-yui3-calender

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!