Пример ниже работает хорошо. Я хочу, чтобы перемещал дату одну за другой по клику назад / вперед при просмотре по умолчанию. По умолчанию в настоящее время timelineWeek
в течение двух недель. Я хочу настройки для ежемесячных, еженедельных, ежегодных тоже.
Я пробовал dateIncrement: { days: 1 }
. Но он не работает в представлении по умолчанию.
$(function() {
$('#calendar').fullCalendar({
contentHeight: 610,
scrollTime: '00:00',
displayEventTime: false,
displayEventEnd: false,
timeFormat: 'h:mma',
axisFormat: 'HH:mm',
//slotDuration: '24:00',
titleFormat: 'ddd DD MMM YYYY',
columnFormat: 'ddd DD/M',
resourceAreaWidth: 200,
defaultView: 'timelineWeek',
duration: {
days: 15
},
slotDuration: {
"hours": 12
},
slotLabelInterval: {
"hours": 24
},
minTime: "00:00:00",
maxTime: "24:00:00",
height: 610,
contentHeight: "40",
header: {
left: 'prev, today',
center: 'title',
right: 'oneweek,twoweek,onemonth,oneyear,next'
},
views: {
oneyear: {
buttonText: 'One Year',
type: 'timelineYear',
dateIncrement: { days: 1 }
},
twoweek: {
buttonText: 'Two Week',
type: 'timelineWeek',
dragScroll: true,
dateIncrement: { days: 1 },
duration: { days: 15 }
},
onemonth: {
buttonText: 'One Month',
type: 'timelineMonth',
dateIncrement: { days: 1 }
},
},
//hiddenDays: [ 10 ],
businessHours: {
start: '09:00',
end: '20:00'
},
resourceLabelText: 'Rooms',
resources: 'https://fullcalendar.io/demo-resources.json',
events: 'https://fullcalendar.io/demo-events.json?with-resources'
});
});
html,
body {
margin: 0;
padding: 0;
font-family: "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
font-size: 14px;
}
#calendar {
max-width: 900px;
margin: 40px auto;
}
<link href="https://unpkg.com/fullcalendar@3.10.1/dist/fullcalendar.min.css" rel="stylesheet" />
<link href="https://unpkg.com/fullcalendar-scheduler@1.10.0/dist/scheduler.min.css" rel="stylesheet" />
<script src="https://unpkg.com/moment@2.24.0/min/moment.min.js"></script>
<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.min.js"></script>
<script src="https://unpkg.com/fullcalendar@3.10.1/dist/fullcalendar.min.js"></script>
<script src="https://unpkg.com/fullcalendar-scheduler@1.10.0/dist/scheduler.min.js"></script>
<div id='calendar'></div>