我想创建一个使用完整日历的学校时间表。
它应该是这样的:链接
我的问题是,完整的日历总是显示工作日旁边的日期。("Wed - 04/27“、”清华- 04/28“、.)
我想要的是,只有星期一到星期五,没有日期,也没有机会转到下一个星期。这应该是个抽象的星期。有办法做到这一点吗?
谢谢你的帮助。
发布于 2016-04-27 09:56:00
在玩了所有的插件功能,你可以在这里找到在文档,我有一个工作日历!
如下所示:
以下是代码:
var calendar = $('#trainingszeitenCalendar').fullCalendar({
//lang: 'de',
header: { // Display nothing at the top
left: '',
center: '',
right: ''
},
eventSources: ['events.php'],
height: 680, // Fix height
columnFormat: 'dddd', // Display just full length of weekday, without dates
defaultView: 'agendaWeek', // display week view
hiddenDays: [0,6], // hide Saturday and Sunday
weekNumbers: false, // don't show week numbers
minTime: '16:00:00', // display from 16 to
maxTime: '23:00:00', // 23
slotDuration: '00:15:00', // 15 minutes for each row
allDaySlot: false, // don't show "all day" at the top
select: function(start, end, allDay) {
// Code for creating new events.
alert("Create new event at " + start);
},
eventResize: function( event, delta, revertFunc, jsEvent, ui, view ) {
// Code when you resize an event (for example make it two hours longer
alert("I just got resized!");
},
eventDrop: function( event, jsEvent, ui, view ) {
// Code when you drop an element somewhere else
alert("I'm somewhere else now");
}
}
// With the next line I set a fixed date for the calendar to show. So for the user it looks like it's just a general week without a 'real' date behind it.
$('#trainingszeitenCalendar').fullCalendar( 'gotoDate', '2000-01-01');
编辑
我创建了一个具有不同事件的MYSQL表。事件发生在1999-12-27
和2000-01-02
之间。要将事件添加到表中,需要一个单独的php文件来返回所有的事件对象(参见下面的代码)。拖放可以通过操作执行(如上面的代码所示)。
events.php
<?php
$fetch = "YOUR SQL Statement";
$query = mysqli_query....; // Execute fetch
$event_array = array();
while ($event = mysqli_fetch_array($query, MYSQL_ASSOC)) {
$id = $event['ID'];
$title = $event['Title'];
$description = $event['Description'];
$startdatum = $event['Start'];
$enddatum = $event['Ende'];
// Add event object to JSON array
// For more options check the fullcalendar.io docs
$event_array[] = array(
'id' => $id,
'title' => $title,
'description' => $description,
'start' => $startdatum,
'end' => $enddatum
);
}
echo json_encode($event_array);
?>
https://stackoverflow.com/questions/36884666
复制相似问题