Reputation: 706
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.
Upvotes: 0
Views: 291
Reputation: 484
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.
Upvotes: 1