I have been using fullcalendar plugin successfully for a few months and suddenly ran into a bug. It won’t display an event on March 31st 2012. This behavior doesn’t happen on our test site server running php v5.3.8, but does on our live site server. That server is running php v5.3.6.
Can someone shed some light on this situation. Is it possibly related to daylight savings? How do I fix this?
Thanks for any help.
CODE:
<script type="text/javascript">
$(document).ready(function() {
$('#calendar').fullCalendar({
theme: "true",
aspectRatio: 1.8,
weekMode: 'liquid',
header: {
left: "",
center: "prev title next",
right: ""
},
buttonIcons:{
prev: "triangle-1-w",
next: "triangle-1-e"
},
eventSources: [
{
url: 'VS_race_events.php', // Event Source One //
type: 'POST',
error: function() {
alert('there was an error while fetching events!');
},
color: '#006600',
textColor: 'white'
},
{
url: 'VS_work_events.php', // Event Source Two //
type: 'POST',
error: function() {
alert('there was an error while fetching events!');
},
borderColor: '#006600',
color: 'beige',
textColor: '#333333'
}
],
eventClick: function(calEvent, jsEvent, view) {
$("#dialog_frame").css("visibility", "visible");
$("#dialog_frame").draggable("enable");
$(".dialog_content").html(calEvent.description);
$(".dialog_title").html(calEvent.title);
}
})
});
</script>
Here is VS_work_event file:
<?php
require_once('Connections/HDAdavePDO.php');
if (isset($_POST['start'])) {
$unix_start = $_POST['start'];
$date_start = strftime("%Y-%m-%d",$unix_start);
}
if (isset($_POST['end'])) {
$unix_end = $_POST['end'];
$date_end = strftime("%Y-%m-%d",$unix_end);
}
$pdo = new PDO('mysql:host=' . $host . ';dbname='.$database, $username, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt2 = $pdo->prepare('SELECT * FROM vs_events WHERE event_date >= ? AND event_date < ?');
$stmt2->bindParam(1, $date_start);
$stmt2->bindParam(2, $date_end);
$stmt2->execute();
$stmt2->setFetchMode(PDO::FETCH_ASSOC);
$row_Calendar = $stmt2->fetchAll();
foreach ($row_Calendar as $row){
if ($row['event_type'] == 13 && $row['active'] == 1){
$display_date = substr($row['event_date'],0,10);
$eventsArray['id'] = $row['event_id'];
$eventsArray['start'] = $display_date;
$eventsArray['title'] = $row['event_subject'];
$eventsArray['description'] = $row['event_text'];
$eventsArray['type'] = $row['event_type'];
$events[] = $eventsArray;
}
}
echo json_encode($events);
$pdo = null;
?>
Looking at the JSON response of both of your event sources, there is no event that I can see that takes place on March 31st.
Your issue is likely on your server side querying of events or the event record itself, and not with FullCalendar.