Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 862497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:09:08+00:00 2026-05-15T09:09:08+00:00

Using FullCalendar ( http://arshaw.com/fullcalendar/ ) to pull events from a MySQL database table via

  • 0

Using FullCalendar (http://arshaw.com/fullcalendar/) to pull events from a MySQL database table via JSON. The events are being displayed in the calendar but for some reason it is ignoring the time (hours, minutes, seconds) of the event. Here is the Javascript from the calendar page –

<script type='text/javascript'>
$(document).ready(function() {
  $('#calendar').fullCalendar({
    editable: false,
    events: "json-events.php",

    eventDrop: function(event, delta) {
      alert(event.title + ' was moved ' + delta + ' days\n' +
        '(should probably update your database)');
    },

    loading: function(bool) {
      if (bool) $('#loading').show();
      else $('#loading').hide();
    }
  });
});
</script>

and my JSON PHP file (note that I am including the time after the date, presently that field is set as DATE only):

<?php
include $_SERVER['DOCUMENT_ROOT'] . '/includes/pdo_conn.inc.php';
$getEventsSQL = $db->query("SELECT id, title, date_start AS start, date_end AS end FROM training");

$events = array();
while ($row = $getEventsSQL->fetch()) {
    $start = $row['start'];
    $end = $row['end'];
    $title = $row['title'];
    $eventsArray['id'] =  $row['id'];
    $eventsArray['title'] = $title;
    $eventsArray['start'] = $start . " 13:00:00";
    $eventsArray['end'] = $end . " 14:00:00";
    $eventsArray['url'] = "http://somewhere.org";
    $events[] = $eventsArray;
}


echo json_encode($events);
?>

The above outputs:

[{
  "id": "13",
  "title": "Test 1",
  "start": "2010-05-18 13:00:00",
  "end": "0000-00-00 14:00:00",
  "url": "http:\/\/tapp-essexvfd.org"
}, {
  "id": "14",
  "title": "Test 2",
  "start": "2010-06-18 13:00:00",
  "end": "2010-06-19 14:00:00",
  "url": "http:\/\/tapp-essexvfd.org"
}, {
  "id": "15",
  "title": "Test 3",
  "start": "2010-06-18 13:00:00",
  "end": "0000-00-00 14:00:00",
  "url": "http:\/\/somewhere.org"
}, {
  "id": "16",
  "title": "test4",
  "start": "2010-05-03 13:00:00",
  "end": "0000-00-00 14:00:00",
  "url": "http:\/\/somewhere.org"
}]

Thanks!

Edit

Here is the modified PHP to reflect the accepted solution. Thanks!

    <?php
include $_SERVER['DOCUMENT_ROOT'] . '/includes/pdo_conn.inc.php';
$getEventsSQL = $db->query("SELECT id, title, date_start AS start, time FROM events WHERE date_start >= NOW() AND status = 1");

$events = array();
while ($row = $getEventsSQL->fetch()) {
    $start = $row['start'];
    $title = $row['title'];
    $eventsArray['id'] =  $row['id'];
    $eventsArray['title'] = $title;
    $eventsArray['start'] = $start . " " . $row['time'];
    $eventsArray['end'] = $end;
    $eventsArray['url'] = "#";
    $eventsArray['allDay'] = false;
    $events[] = $eventsArray;
}


echo json_encode($events);
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T09:09:09+00:00Added an answer on May 15, 2026 at 9:09 am

    Try adding ‘allDay’: false to your json. I had the same issue, see ‘allDay’ documentation specifically:

    Don’t include quotes around your true/false. This value is not a string!

    When specifying Event Objects for events or eventSources, omitting this property will make it inherit from allDayDefault, which is normally false.

    However, ‘allDayDefault’ defaults to true?!?

    http://arshaw.com/fullcalendar/docs/event_data/Event_Object/

    http://arshaw.com/fullcalendar/docs/event_data/allDayDefault/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 465k
  • Answers 465k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer From what I remember MySQLs Regex support is very simplistic… May 16, 2026 at 1:20 am
  • Editorial Team
    Editorial Team added an answer Google provide a great Geocoding API. It supports JSON and… May 16, 2026 at 1:20 am
  • Editorial Team
    Editorial Team added an answer First the problem, nothing's fading because you're trying to fade… May 16, 2026 at 1:20 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.