0
上FullCalendarイベントをレンダリングし、すべてがFirefoxとただしIE 9は、イベントはIE 7とIE上でレンダリングされていないとうまく動作します8.ここでIE 7&IはFullCalendarプラグインを使用しています8
は私のjavascriptのですコード:
$(document).ready(function() {
initCalendar();
var currentMonth;
var currentYear;
var todayMonth;
var todayYear;
function initCalendar() {
var currentDate = new Date();
currentMonth = (currentDate.getMonth() + 1 < 10 ? '0'+(currentDate.getMonth() + 1) : currentDate.getMonth() + 1);
currentYear = currentDate.getYear() + 1900;
todayMonth = currentMonth;
todayYear = currentYear;
var language = $('#param_language').val();
var listMonth = ['JANUARY','FEBRUARY','MARCH','APRIL','MAY','JUNE','JULY','AUGUST','SEPTEMBER','OCTOBER','NOVEMBER','DECEMBER'];
var listDayShort = ['SUNDAY','MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY','SATURDAY'];
if (language == 'fr_FR') {
listMonth = ['JANVIER','FEVRIER','MARS','AVRIL','MAI','JUIN','JUILLET','AOUT','SEPTEMBRE','OCTOBRE','NOVEMBRE','DECEMBRE'];
listDayShort = ['DIMANCHE','LUNDI','MARDI','MERCREDI','JEUDI','VENDREDI','SAMEDI'];
}
$('#calendar').fullCalendar({
editable: true,
disableDragging : true,
disableResizing : true,
eventClick: function (event) {
window.location = '/calendar/caldetail/id/'+event.id+'/num/'+event.timestamp;
},
monthNames:listMonth,
dayNamesShort:listDayShort
});
$('.fc-button-prev').click(function() {
currentMonth --;
if (currentMonth == 0) {
currentMonth = 12;
currentYear --;
}
if (currentMonth-1 == 0) {
getAllMonthEvent(12, parseInt(currentYear)-1);
} else {
getAllMonthEvent(parseInt(currentMonth)-1, currentYear);
}
});
$('.fc-button-next').click(function() {
currentMonth ++;
if (currentMonth == 13) {
currentMonth = 1;
currentYear++;
}
if (parseInt(currentMonth)+1 == 13) {
getAllMonthEvent(1, parseInt(currentYear)+1);
}
else {
getAllMonthEvent(parseInt(currentMonth)+1, currentYear);
}
});
$('.fc-button-today').click(function() {
currentMonth = todayMonth;
currentYear = todayYear;
getAllMonthEvent(currentMonth, currentYear);
});
if (parseInt(currentMonth)-1 == 0) {
getAllMonthEvent(12, parseInt(currentYear)-1);
} else {
getAllMonthEvent(parseInt(currentMonth)-1,currentYear);
}
getAllMonthEvent(currentMonth, currentYear);
if (parseInt(currentMonth)+1 == 13) {
getAllMonthEvent(1, parseInt(currentYear)+1);
} else {
getAllMonthEvent(parseInt(currentMonth)+1, currentYear);
}
}
});
function getAllMonthEvent(month, year) {
if (!isAlreadyGenerated(month, year)) {
messbox.open(MSG_LOADING);
var params = {
month: month,
year:year
};
$.post("/calendar/getallevents",
params,
function(data){
messbox.close();
addGeneratedDate(month, year);
$.each(data, function(i, calevent){
$('#calendar').fullCalendar('renderEvent', calevent, true);
});
},
'json'
);
}
}
var listGeneratedPage = new Array();
function addGeneratedDate(month,year) {
var elt = new Array(month, year);
listGeneratedPage.push(elt);
}
function isAlreadyGenerated(month, year) {
for (i=0; i<listGeneratedPage.length; i++) {
if (listGeneratedPage[i][0] == month && listGeneratedPage[i][1] == year) {
return true;
}
}
return false;
}
そして、ここでは私のコントローラ(PHPコード)である:
foreach($listCalendar as $calendar) {
if($calendar->getTimezone()){
$date = new DateTime($calendar->getDate(), new DateTimeZone('GMT'));
$date->setTimezone(new DateTimeZone($user->getTimezone()));
$datetime = $date->format('Y-m-d H:i:s');
} else{
$datetime = $calendar->getDate();
$datetime = @date('Y-m-d H:i:s',strtotime($datetime));
}
$timestamp = strtotime($datetime);
$tmp = explode(' ',$datetime);
$hour = explode(':',$tmp[1]);
$className = 'event-type-other';
if ($calendar->getType() == 'R') {
$className = 'event-type-running';
}
if ($calendar->getFrequency() == 'N' && $calendar->getPeriod()) {
$elt = array(
'id' => $calendar->getId(),
'timestamp' => $timestamp,
'title' => substr($calendar->getName(),0,12).' ('.$hour[0].':'.$hour[1].')',
'start' => $calendar->getDate(),
'end' => date('Y-m-d H:i:s',strtotime("+".$calendar->getPeriod()." minutes", strtotime($calendar->getDate()))),
'className' => $className
);
} else {
$elt = array(
'id' => $calendar->getId(),
'timestamp' => $timestamp,
'title' => substr($calendar->getName(),0,12).' ('.$hour[0].':'.$hour[1].')',
'start' => $calendar->getDate(),
'className' => $className
);
}
$listEvent [] = $elt;
}
echo json_encode($listEvent);
どのように私はこの問題を解決することができますか?また、誰かがIE用のデバッグツールを知っていれば、それは私を大きく助けることができます。
IE8以降を使用している場合は、F12キーを押してください。 – lsuarez