scheduler doesn't display any events loaded from json data

Hi I’m trying to load data from the database using json. It seems to load fine based on response data, but the scheduler doesn’t display any events.

This is the connector I am using, is there any mistake that I am unaware of?

// php/data.php
<?php
	include ('../codebase/connector/scheduler_connector.php');

	$conn = mysql_connect("localhost", "root", "", "scheduler");
	mysql_select_db("scheduler", $conn);

	$scheduler = new JSONSchedulerConnector($conn);
	$scheduler->enable_log("log.txt", true);
	$scheduler->render_table("shifts", "id", "start_date,end_date,text,location,section,comment");
scheduler.init('scheduler_here', new Date(2009, 5, 30), "fairview");
scheduler.load('php/data.php', 'json');

Hello,
are there any error messages in browser console?
scheduler might not display events if some of them have null values in start or end date

I’m not able to see any errors in the console. I only see this output:

XHR finished loading: "http://localhost/scheduler/php/data.php?timeshift=240".

If it will help, I also included a sample JSON data returned from the database. FYI the ‘text’ field has JSON data in it. Is it a bad practice to embed JSON data within another JSON data??

{ "data":[{"id":"4","start_date":"Tue Jun 30 2009 07:25:00 GMT-0300 (Atlantic Daylight Time)","end_date":"Tue Jun 30 2009 07:30:00 GMT-0300 (Atlantic Daylight Time)","text":"employee:[{\"name\":\"James P\",\"time\":\"07:00\"}]","location":"fairview","section":"front","comment":"test"}]}

I also included my custom table for the scheduler as well.

+------------+---------------+------+-----+---------+----------------+
| Field      | Type          | Null | Key | Default | Extra          |
+------------+---------------+------+-----+---------+----------------+
| id         | int(11)       | NO   | PRI | NULL    | auto_increment |
| start_date | varchar(100)  | YES  |     | NULL    |                |
| end_date   | varchar(100)  | YES  |     | NULL    |                |
| text       | varchar(5000) | NO   |     | NULL    |                |
| location   | varchar(50)   | YES  |     | NULL    |                |
| section    | varchar(50)   | YES  |     | NULL    |                |
| comment    | varchar(500)  | YES  |     | NULL    |                |
+------------+---------------+------+-----+---------+----------------+

Hi,
Event dates are in incorrect format,
here is some info
docs.dhtmlx.com/doku.php?id=dhtm … ntegration

Try storing dates in datetime instead of varchar. If it’s not possible you’ll have to modify scheduler.config.xml date setting to match format of your dates
docs.dhtmlx.com/doku.php?id=dhtm … g.xml_date
docs.dhtmlx.com/doku.php?id=dhtm … ngs_format

Thanks Aliaksandr, changing the start_date and end_date format to datetime in the table and formatting the date string to match the scheduler.config.xml_date fixed the issue for me. :slight_smile: