Key value format not correct for JSON

I’m trying to use Laravel and DHtmlX Scheduler. I’ve got Laravel sending data from the controller in the following format:

[{"id":1,"text":8,"start_date":"2013-10-23 00:00:00","end_date":"2013-10-24 00:00:00"},{"id":2,"text":8,"start_date":"2013-10-23 07:00:00","end_date":"2013-10-23 08:22:00"}]

According to everything I’ve read this is valid JSON and is the default that Laravel sends. DHtmlX is expecting the same code in this format:

[{id:1,text:8,start_date:"2013-10-23 00:00:00",end_date:"2013-10-24 00:00:00"},{id:2,text:8,start_date:"2013-10-23 07:00:00",end_date:"2013-10-23 08:22:00"}]

Which is just a JS array, not valid JSON. (Notice absence of “” on key) How can I change what DHtmlX is expecting so it supports valid JSON?


First one is the standard JSON
Second one is a variation that still can be processed by javascript
Both are valid, and dhtmlxScheduler is able to load both

The calendar is being displayed and it’s still not showing any events. This is how I have it initialized. Have I done this correctly?

scheduler.init('scheduler_here', new Date(),"month"); scheduler.load('shifts/data', 'json');

Try to define the date format before data loading

		scheduler.config.xml_date="%Y-%m-%d %H:%i";

Place this line before scheduler.load command.

Nearly solved it. I put it before load and it still didn’t show. I put it before init and bingo. Thanks for your help!