在 YUI3 日历中使用多个 disabledDatesRule [英] Using multiple disabledDatesRule in YUI3 calender

查看:39
本文介绍了在 YUI3 日历中使用多个 disabledDatesRule的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在加载一个动态阻止日期的日历,从数据源中提取它们.问题是,我无法设置多个 disabledDatesRules.它是一个或另一个.这似乎有点愚蠢且无济于事,尤其是在设置规则的方式方面.我无法想象是这种情况,所以我想知道是否有人知道如何使用多个 disabledDatesRule.例如,

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.

谢谢.

推荐答案

我是 YUI 3 日历的创建者,只是确认您的解决方案是正确的——您可以有多个具有相同名称的不同规则,并且它们都会匹配.

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.

这篇关于在 YUI3 日历中使用多个 disabledDatesRule的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆