0

我正在加载一个动态阻止日期的日历,从数据源中提取它们。问题是,我不能设置多个 disabledDatesRules。它是一个或另一个。这似乎有点愚蠢,根本没有帮助,尤其是在设置规则的方式上。我无法想象是这样,所以我想知道是否有人知道如何使用多个 disabledDatesRule。例如,

 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(); 

我在任何地方都没有看到任何帮助。我已经看到如何使某些日期更漂亮,但这对我没有丝毫帮助。

谢谢。

4

1 回答 1

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.

于 2012-09-19T21:11:05.737 回答