मैं इसे किसी भी तरह गलत कर रहा हूं। मैं Fullcalendar
के साथ टाइमज़ोन पर ट्राइप कर रहा हूं। मैंने ignoreTimezone
को सही और गलत पर सेट करने का प्रयास किया है, लेकिन यह कोई फर्क नहीं पड़ता। यह दो स्थानों पर नीचे दिए गए कोड में है क्योंकि मुझे उस दस्तावेज़ से निश्चित नहीं था जहां यह जाता है।फुल कैलेंडर और टाइमज़ोन। सहायता, मैं इसे गलत कर रहा हूं
मेरा डेटा स्रोत एक छिपी हुई फॉर्म फ़ील्ड है। डेटा FullCalendar
को 5 घंटे (सीडीटी) जोड़कर समायोजित किया जाता है। से FullCalendar
में डेटा 5 घंटे को हटाकर समायोजित नहीं किया जाता है।
बैक-एंड पर, मैं सिर्फ बचत कर रहा हूँ और यह प्रसंस्करण के बिना JSON स्ट्रिंग लौट (या यहां तक कि इसे डीकोड)
Page Load:
Data In: Empty, no data
Data Edit: drag from noon to 2pm (CDT), then submit form
Data Out: Use clientEvent to get data, and JSON.stringify to put into form field.
[{"id":6844,"title":"Open","start":"2011-04-19T17:00:00.000Z","end":"2011-04-19T19:00:00.000Z","allDay":false}]
Page Load (after submitting form):
Data In: Use JSON.parse to load data from hidden form field. This is the incoming data, but the event is shifted to 5pm (CDT) in the control.
[{"id":6844,"title":"Open","start":"2011-04-19T17:00:00.000Z","end":"2011-04-19T19:00:00.000Z","allDay":false}]
Data Out: Without changing the control, it's now:
[{"id":6844,"title":"Open","start":"2011-04-19T22:00:00.000Z","end":"2011-04-20T00:00:00.000Z","allDay":false}]
मैं सेटअप Fullcalendar
इस तरह:
// Fullcalendar for business hours page
jQuery(document).ready(function() {
jQuery('#edit-submit').bind("click", business_hours_set);
jQuery('#edit-preview').bind("click", business_hours_set);
jQuery('#calendar').fullCalendar({
// configure display
header: {
left: '',
center: '',
right: ''
},
ignoreTimezone: false,
defaultView: 'agendaWeek',
allDaySlot: false,
firstHour: 8,
// configure selection for event creation
selectable: true,
selectHelper: true,
select: business_hours_add,
// configure data source
editable: true,
eventSources: [
{
events: jQuery.parseJSON(jQuery('#fullcalendar_data').val()),
color: '#992B0A',
textColor: 'white',
ignoreTimezone: false
}
],
// configure editing
eventClick: function(calEvent) {
business_hours_delete(calEvent.id);
}
});
alert(jQuery('#fullcalendar_data').val());
});
function business_hours_add(startDate, endDate) {
var calendar = jQuery('#calendar');
var newid = Math.ceil(Math.random()*64000);
calendar.fullCalendar('renderEvent',
{
id: newid,
title: "Open",
start: startDate,
end: endDate,
allDay: false
},
true // make the event "stick"
);
calendar.fullCalendar('unselect');
}
var business_hours_selectedId = -1;
function business_hours_delete(id) {
business_hours_selectedId = id;
jQuery("#dialog-confirm").dialog({
resizable: false,
height:160,
modal: true,
buttons: {
"Yes, delete!": function() {
calendar = jQuery('#calendar');
calendar.fullCalendar('removeEvents', business_hours_selectedId);
jQuery(this).dialog("close");
},
Cancel: function() {
jQuery(this).dialog("close");
}
}
}, id);
}
function business_hours_set() {
var data = jQuery('#calendar').fullCalendar('clientEvents');
// data is cyclical. Create a new data structure to stringify.
var ret = [];
for(var i=0; i<data.length; i++) {
var datum = {
id: data[i].id,
title: data[i].title,
start: data[i].start,
end: data[i].end,
allDay: data[i].allDay
}
ret[i] = datum;
}
// stringify and return
jQuery('#fullcalendar_data').val(JSON.stringify(ret));
alert(JSON.stringify(ret));
}
मैं क्या गलत कर रहा हूं?
अग्रिम धन्यवाद, माइक
माइक के पास आपको इसका समाधान मिला है, मुझे भी एक ही समस्या का सामना करना पड़ रहा है – Devjosh