简体   繁体   English

jQuery FullCalendar渲染事件在月视图中的错误日期

[英]JQuery FullCalendar rendering events on wrong day in month view

EDIT TL;DR:figured out what was causing the problem temporarily, IE compatibility mode breaks this plugin (v2.5) in IE10 10.0.34 EDIT TL; DR:临时找出了造成此问题的原因,IE兼容模式在IE10 10.0.34中破坏了此插件(v2.5)

EDIT: I'm a noob it's IE10. 编辑:我是菜鸟,它是IE10。 Even considering I'd turned off drag and drop and editing IE10 is building it wrong somehow. 即使考虑到我已关闭拖放功能并编辑IE10,也以某种方式将其构建为错误。 I do almost all my testing in IE10 as it is the mandated browser for in house web apps, fullcalendar shows IE8+ compatibility on their page so I hadn't tested it across browsers until just now out of desperation/rage. 我几乎在IE10中进行了所有测试,因为它是内部Web应用程序的强制性浏览器,fullcalendar在其页面上显示了IE8 +兼容性,因此直到现在,出于绝望/愤怒,我还没有跨浏览器对其进行过测试。 Has anyone had issues with this? 有人对此有疑问吗? Any ideas how I can fix it or how to go about maybe tracing the problem? 关于如何解决它或如何解决问题的任何想法,也许可以找到问题所在? It's a bit out of my wheelhouse but I want this thing to work and by the Gods I will make it work or die trying. 它有点超出我的操舵能力,但是我希望这个东西能够正常工作,在众神的帮助下,我会让它正常工作或尝试失败。

I was attempting to use fullcalendar as part of a front end for a simple display. 我试图将全日历用作前端的一部分,以进行简单的显示。 The web application is served with Oracle Portal which may have some bearing. 该Web应用程序与Oracle Portal一起使用,可能会有一定的影响。

Here is the calendar initialization script, it binds to a div so nothing fancy: 这是日历初始化脚本,它绑定到div,所以没什么花哨的:

<script>
$(document).ready(function() {
    var events = [];
    var e = {}
    <%FOR event_rec in month_events LOOP%>
    e = {
                id: "<%=event_rec.event_id%>",
                title: "<%=event_rec.event_name%>",
                start: "<%=event_rec.event_day%>T<%=to_char(event_rec.start_hr,'FM00')%>:<%=to_char(event_rec.start_min,'FM00')%>:00",
                end: "<%=event_rec.event_day%>T<%=to_char(event_rec.end_hr,'FM00')%>:<%=to_char(event_rec.end_min,'FM00')%>:00",
                description: "<%=event_rec.notes%>"
        };
    events.push(e);
    <%end LOOP;%>

    $("#calendar").fullCalendar({
        header: {
            left: "prev,next",
            center: "title",
            right: "month,basicWeek,basicDay"
        },
        titleFormat: 'MMMM D, YYYY',
        buttonText: {
            prev: 'Previous',
            next: 'Next'
        },
        defaultDate: "<%=v_default_date%>",
        editable:false,
        allDayDefault:false,
        eventStartEditable:false,
        eventDurationEditable:false,
        eventLimit:true,
        eventOrder:"start", 
        dayClick: function(date, jsEvent, view) {
                //Open day by clicking on tile
                $('#calendar').fullCalendar( 'gotoDate', date );
                $('#calendar').fullCalendar( 'changeView', "basicDay" );
        },
        timezone : 'local'      
    });

    $('#calendar').fullCalendar('addEventSource',events);

});

Those <%= %> tags denote where it's calling the faux code behind that is oracle portal, it is looping through a small cursor which yes, is less than an ideal way to do this but it is all I can do. 这些<%=%>标记表示它在哪里调用了oracle门户后面的伪代码,它正在循环通过一个小游标,是的,这不是理想的方法,但这是我所能做的。

It looks like this on page load/render: 在页面加载/渲染上看起来像这样:

e = {
                id: "1",
                title: "Test Event 1",
                start: "2015-12-10T11:00:00",
                end: "2015-12-10T14:00:00",
                description: "Testing Notes"
        };

Now for the fun part: 现在是有趣的部分:

Image 图片

See those days circled in red? 看到那些日子都用红色圈起来吗? Those days have no events, all the events are on the 10th and 12th. 那些日子没有活动,所有活动都在10日和12日举行。 I cannot for the life of me figure out why these events are displaying in the wrong days. 我一辈子都无法弄清楚为什么这些事件在错误的日子出现。 First thought was a data issue with that array I'm filling, like something was typed wrong or formatted wrong but all the dates have identical start/end times as I didn't changed those values at first when making test cases. 首先想到的是我要填充的那个数组的数据问题,就像输入错误或格式错误,但是所有日期都有相同的开始/结束时间,因为在制作测试用例时我最初没有更改这些值。

Any ideas? 有任何想法吗? I'm completely out of them. 我完全没有他们了。 Usually in these situations it's something small I overlooked, and as soon as I ask for help I spot it. 通常在这些情况下,这是我忽略的小事情,一经寻求帮助,我便立即发现它。 I'm banking on this, or someone smarter than I to spot the screw up. 我要依靠这个,或者比我更聪明的人来发现问题。

Compatibility mode in IE10 (10.0.34) breaks the fullcalendar app (or JQuery) from version 2.5, making events render on the wrong date cells in month view but remain correct in date or week views. IE10(10.0.34)中的兼容模式打破了2.5版的全日历应用程序(或JQuery),使事件在月视图中的错误日期单元格上呈现,但在日期或周视图中仍然正确。

Turning it off solved my issue at least for the time being (if you are running legacy apps that require compatibility mode for some cases in a hodgepodge of outdated spaghetti code from hell like I am, this may not be a viable long term fix) 至少暂时关闭该功能可以解决我的问题(如果像我一样,在某些情况下,如果您运行的旧版应用在某些情况下需要兼容模式,那么我可能会遇到来自地狱的过时意大利面条代码,这可能不是一个可行的长期解决方案)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM