FullCalendar jquery json Events MySQL Problem
I've got the problem that i can't display events in my Calendar and i don't now why... the dateformat is correct... if i try it with normal events out of the json... i mean with the sample events out of the Demo... it works fine... but if get my events out of my MSQL i never see an event
heres the code from the SQl Satemaent and the Array Creation
while($res = mysql_fetch_assoc($result)){
$start = $res['start'];
$end = $res['end'];
$title = $res['title'];
$eventStart = ($开发者_StackOverflowstart/1000);
$eventEnd = ($end/1000);
$rows[] = array(
'id' => $res['id'],
'title' => $title,
'start' => str_replace("+00:00", " +01:00",date('c',$eventStart)),
'end' => str_replace("+00:00", " +01:00",date('c',$eventEnd)),
'allDay' => false,
);
}
return $rows;
and here are the json.php
$arrEvents = getView(($_REQUEST['start']*1000), ($_REQUEST['end'])*1000);
var_dump($arrEvents);
echo json_encode($arrEvents);
this is the result:
[{"id":"10","title":"Urlaub","start":"2010-11-24T07:30:00+01:00","end":"2010-11-24T16:15:00+01:00","allDay":false}]
so if anyone can give me a hand or a tip how i can fix this bug... i'm very pleasend
thanks
When I try the following sample code using your "start" value:
<html>
<head>
<script type="text/javascript">
var today=new Date('2010-11-24T07:30:00+01:00');
alert(today);
</script>
</head>
<body onload="startTime()">
<div id="txt"></div>
</body>
</html>
I get "Invalid Date" for the alert. Try formatting your dates for start and end via the date object's valid formats. FullCalendar uses JS date formatting under the hood.
set allDaySlot: false parameter when you initialize:
editable: true,
theme: true,
contentHeight:600,
minTime: 7,
maxTime: 18,
allDaySlot: false,
精彩评论