提问人:srikant torkade 提问时间:11/9/2023 最后编辑:srikant torkade 更新时间:11/10/2023 访问量:55
将事件放在完整日历中的营业时间是否正确?
Is it right to place events on Business hours in fullcalendar?
问:
- 当事件从资源拖放到营业时间时,它允许处于灰色区域(营业时间)。这是对的吗?
- 当事件拖动以更改时间段时,它仍然允许放置在营业时间
document.addEventListener("DOMContentLoaded", function () {
var calendarEl = document.getElementById("calendar");
var calendar = new FullCalendar.Calendar(calendarEl, {
timeZone: "UTC",
initialView: "resourceTimelineDay",
aspectRatio: 1.5,
headerToolbar: {
left: "prev,next",
center: "title",
right: "resourceTimelineDay,resourceTimelineWeek,resourceTimelineMonth"
},
editable: true,
resourceAreaHeaderContent: "Rooms",
businessHours: {
// days of week. an array of zero-based day of week integers (0=Sunday)
daysOfWeek: [1, 2, 3, 4], // Monday - Thursday
startTime: "12:00", // a start time (10am in this example)
endTime: "18:00" // an end time (6pm in this example)
},
resources: [
{ id: "a", title: "Resource A" },
{ id: "b", title: "Resource B" }
],
events: [
{ title: "Event 2", start: "2023-11-10", resourceId: "a" },
{ title: "Event 3", start: "2023-11-10", resourceId: "b" }
]
});
calendar.render();
});
html,
body {
margin: 0;
padding: 0;
font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
font-size: 14px;
}
#calendar {
max-width: 1100px;
margin: 40px auto;
}
<div id='calendar'></div>
<link href='fullcalendar/core/main.css' rel='stylesheet' />
<link href='fullcalendar/daygrid/main.css' rel='stylesheet' />
<script src='fullcalendar/core/main.js'></script>
<script src='fullcalendar/daygrid/main.js'></script>
<script src='https://cdn.jsdelivr.net/npm/full[email protected]/index.global.min.js'></script>
请帮助我分享您的结论和答案
答: 暂无答案
评论