renderCalendar
Description
生成一个紧凑型日历
renderCalendar: (config: any) => HTMLElement
Parameters
config- (required) object - 日历的配置设置对象
Returns
div- (HTMLElement) - 日历的HTML元素
Example
const calendar = scheduler.renderCalendar({
container:"cal_here",
navigation:true,
handler:function(date, calendar){
scheduler.setCurrentView(date, scheduler._mode);
}
});
Related samples
Details
注释
此方法需要启用 minical 插件。
配置对象可包含以下属性:
| container | (string, object) 日历将被放置的HTML容器(或其ID)。此项为可选。 |
| position | (object) 指定日历的位置。可以是坐标对象或HTML元素的ID。 |
| date | (string) 设置日历初始显示的日期 |
| navigation | (boolean) 切换是否显示月份导航按钮 |
| handler | (function) 日期被点击时触发的回调函数。该函数接收被点击的日期和calendar实例作为参数 |
const calendar = scheduler.renderCalendar({
container:"for_calendar",
date:new Date()
});
//
const calendar = scheduler.renderCalendar({
position:"some_id",
date:new Date()
});
//
const calendar = scheduler.renderCalendar({
position: { left: 100, top: 50 },
date:new Date()
});
Related Guides
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.