Timezone for a marked event in FullCalendar

I implement fullcalendar and am struggling with the time zone problem.

Here is the code:

 $('#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 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();
                }
            },

        });

If I create a new event by dropping it, I get a date with the GMT time zone, where, when I need to set the CET, please help fix the event time zone setting.

+4
source share

All Articles