首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >全天候-拖放学校时间表

全天候-拖放学校时间表
EN

Stack Overflow用户
提问于 2016-04-27 08:44:29
回答 1查看 2.6K关注 0票数 2

我想创建一个使用完整日历的学校时间表。

它应该是这样的:链接

我的问题是,完整的日历总是显示工作日旁边的日期。("Wed - 04/27“、”清华- 04/28“、.)

我想要的是,只有星期一到星期五,没有日期,也没有机会转到下一个星期。这应该是个抽象的星期。有办法做到这一点吗?

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-27 09:56:00

在玩了所有的插件功能,你可以在这里找到在文档,我有一个工作日历!

如下所示:

以下是代码:

代码语言:javascript
运行
复制
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-272000-01-02之间。要将事件添加到表中,需要一个单独的php文件来返回所有的事件对象(参见下面的代码)。拖放可以通过操作执行(如上面的代码所示)。

events.php

代码语言:javascript
运行
复制
<?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);

 ?>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36884666

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档