blockTime
警告
此功能已棄用。
Description
阻止给定的日期,并应用默认的"dimmed"样式。
blockTime: (date: Date|number, time_points: any[], items?: any) => void
Parameters
date- (required) Date | number - 要阻止的日期(如果提供的是数字,则视为一周中的某天:
'0' 表示星期天,'6' 表示星期六)time_points- (required) array - 一个数组 [start_minute,end_minute,..,start_minute_N,end_minute_N],
每对定义一个时间范围。数组可以包含任意数量的此类时间段对items- (optional) object - 指定要阻止的视图中特定的项
Example
//阻止每周三从午夜到早上8点的 事件
//但仅限于 Units 视图中 id=1 和 id=4 的项
scheduler.blockTime(3, [0,8*60], { unit: [1,4] });
Related samples
Details
注释
此方法需要启用 limit 插件。
此方法可以多种方式使用,例如:
//阻止2009年5月3日整天
scheduler.blockTime(new Date(2009,5,3), "fullday");
//阻止2009年6月3日从午夜到上午10点的事件
scheduler.blockTime(new Date(2009,6,3), [0,10*60]);
//阻止每个星期六从午夜到早上8点,以及晚上6点到午夜的事件
scheduler.blockTime(6, [0,8*60,18*60,24*60]);
//阻止每个星期天的所有事件
scheduler.blockTime(0, "fullday");
//阻止每周三从午夜到早上8点的事件
//但仅限于 Units 视图中 id=1 和 id=4 的项
scheduler.blockTime(3, [0,8*60], { unit: [1,4] });
//与上面相同,但使用配置对象传递参数
scheduler.blockTime({
days: 3,
zones: [0,8*60],
sections: {
unit: [1,4]
}
});
属性 | 描述 |
|---|---|
| start_date | 定义限制开始时间的 Date 对象 |
| |
| end_date | 定义限制结束时间的 Date 对象 |
| |
| days | 要阻止的天数 |
| |
| zones | 要阻止的时间段(以分钟为单位) |
| |
| css | 应用的 CSS 类名 |
| |
| invert_zones | 是否反转由 'zones' 定义的时间段(默认值为 false) |
| |
| sections | 允许只针对特定视图中的特定项阻止日期。 注意,指定的日期仅在这些视图中被阻止 |
| |
Related API
Change log
- 自 v5.1 起废弃
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.