FullCalendar中已删除事件的时区 [英] Timezone for dropped event in FullCalendar

查看:28
本文介绍了FullCalendar中已删除事件的时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实施完整日历,正在处理时区问题。

代码如下:

 $('#calendar').fullCalendar({ //re-initialize the calendar
            header: h,
            defaultView: 'agendaWeek', // change default view with available options from http://arshaw.com/fullcalendar/docs/views/Available_Views/ 
            slotMinutes: 15,
            editable: true,
            lang: 'pl',
            timezone: 'Europe/Warsaw',
            droppable: true, // this allows things to be dropped onto the calendar !!!
            drop: function(date, allDay) { // this function is called when something is dropped

                // retrieve the dropped element's stored Event Object
                var originalEventObject = $(this).data('eventObject');
                // we need to copy it, so that multiple events don't have a reference to the same object
                var copiedEventObject = $.extend({}, originalEventObject);

                // assign it the date that was reported
                copiedEventObject.start = date;
                var endDate = new Date(date);
                endDate.setMinutes(endDate.getMinutes() + 70);
                copiedEventObject.end = endDate;

                alert(date);
                alert(endDate);
                //copiedEventObject.allDay = allDay;
                copiedEventObject.className = $(this).attr("data-class");

                // render the event on the calendar
                // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
                $('#calendar').fullCalendar('renderEvent', copiedEventObject, true);

                // is the "remove after drop" checkbox checked?
                if ($('#drop-remove').is(':checked')) {
                    // if so, remove the element from the "Draggable Events" list
                    $(this).remove();
                }
            },

        });

如果我通过删除事件来创建新事件,则我得到的是具有GMT时区的日期-时间,其中我应该设置为CET,请帮助如何更正删除事件时区设置。

推荐答案

我遇到过类似的问题。正在将日历属性设置为**时区:‘无’**。否则,您将需要在DateTime字符串中指定时区短码。

这篇关于FullCalendar中已删除事件的时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆