生成一个紧凑型日历
config | object | 日历的配置设置对象 |
HTMLElement | 日历的HTML元素 |
const calendar = scheduler.renderCalendar({
container:"cal_here",
navigation:true,
handler:function(date, calendar){
scheduler.setCurrentView(date, scheduler._mode);
}
});
此方法需要启用 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()
});